Last active
December 28, 2015 00:19
-
-
Save sergeylunev/7412132 to your computer and use it in GitHub Desktop.
Patterns of bad code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$base_path = str_replace($_SERVER['DOCUMENT_ROOT'], '' ,realpath(DIR_ROOT)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Set duration | |
* | |
* @param integer $duration | |
* @return Event | |
*/ | |
public function setDuration($duration) | |
{ | |
$this->duration = $duration; | |
//TODO: Это гребаный костыль, требует исправления и подставления в форму реального поля | |
$this->setDurationTime(new \DateTime(date("c", $this->getDuration()), new \DateTimeZone('UTC'))); | |
return $this; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var baseurl = '{{ asset('') }}'; | |
var lifesite = '{{ app.request.getBaseUrl }}'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Realy bad practice – use zoo of various technologies in parts of same project: