@@ -12,11 +12,11 @@ |
||
| 12 | 12 | use Entities\Address; |
| 13 | 13 | use Entities\User; |
| 14 | 14 | |
| 15 | -$em = require_once __DIR__ . '/bootstrap.php'; |
|
| 15 | +$em = require_once __DIR__.'/bootstrap.php'; |
|
| 16 | 16 | |
| 17 | 17 | ## PUT YOUR TEST CODE BELOW |
| 18 | 18 | |
| 19 | 19 | $user = new User; |
| 20 | 20 | $address = new Address; |
| 21 | 21 | |
| 22 | -echo 'Hello World!' . PHP_EOL; |
|
| 22 | +echo 'Hello World!'.PHP_EOL; |
|
@@ -5,8 +5,8 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | // Path to composer autoloader. You can use different provided by your favorite framework, |
| 7 | 7 | // if you want to. |
| 8 | -$loaderPath = __DIR__ . '/../../vendor/autoload.php'; |
|
| 9 | -if(!is_readable($loaderPath)){ |
|
| 8 | +$loaderPath = __DIR__.'/../../vendor/autoload.php'; |
|
| 9 | +if ( ! is_readable($loaderPath)) { |
|
| 10 | 10 | throw new LogicException('Run php composer.phar install at first'); |
| 11 | 11 | } |
| 12 | 12 | $loader = require $loaderPath; |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | $config = new \Doctrine\ORM\Configuration(); |
| 20 | 20 | |
| 21 | 21 | // Set up Metadata Drivers |
| 22 | -$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__ . "/Entities")); |
|
| 22 | +$driverImpl = $config->newDefaultAnnotationDriver(array(__DIR__."/Entities")); |
|
| 23 | 23 | $config->setMetadataDriverImpl($driverImpl); |
| 24 | 24 | |
| 25 | 25 | // Set up caches, depending on $debug variable. |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | $config->setQueryCacheImpl($cache); |
| 30 | 30 | |
| 31 | 31 | // Proxy configuration |
| 32 | -$config->setProxyDir(__DIR__ . '/Proxies'); |
|
| 32 | +$config->setProxyDir(__DIR__.'/Proxies'); |
|
| 33 | 33 | $config->setProxyNamespace('Proxies'); |
| 34 | 34 | |
| 35 | 35 | // Database connection information |
@@ -95,15 +95,15 @@ |
||
| 95 | 95 | $expressionList[] = $this->dispatch($child); |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - switch($expr->getType()) { |
|
| 98 | + switch ($expr->getType()) { |
|
| 99 | 99 | case CompositeExpression::TYPE_AND: |
| 100 | - return '(' . implode(' AND ', $expressionList) . ')'; |
|
| 100 | + return '('.implode(' AND ', $expressionList).')'; |
|
| 101 | 101 | |
| 102 | 102 | case CompositeExpression::TYPE_OR: |
| 103 | - return '(' . implode(' OR ', $expressionList) . ')'; |
|
| 103 | + return '('.implode(' OR ', $expressionList).')'; |
|
| 104 | 104 | |
| 105 | 105 | default: |
| 106 | - throw new \RuntimeException("Unknown composite " . $expr->getType()); |
|
| 106 | + throw new \RuntimeException("Unknown composite ".$expr->getType()); |
|
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | static public function matchingAssocationFieldRequiresObject($class, $associationName) |
| 30 | 30 | { |
| 31 | 31 | return new self(sprintf( |
| 32 | - "Cannot match on %s::%s with a non-object value. Matching objects by id is " . |
|
| 32 | + "Cannot match on %s::%s with a non-object value. Matching objects by id is ". |
|
| 33 | 33 | "not compatible with matching on an in-memory collection, which compares objects by reference.", |
| 34 | 34 | $class, $associationName |
| 35 | 35 | )); |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | /** |
| 40 | 40 | * @var array |
| 41 | 41 | */ |
| 42 | - private $types = array(); |
|
| 42 | + private $types = array(); |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Converts a comparison expression into the target query language output. |
@@ -231,7 +231,7 @@ |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | if (empty($arguments)) { |
| 234 | - throw ORMException::findByRequiresParameter($method . $by); |
|
| 234 | + throw ORMException::findByRequiresParameter($method.$by); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | $fieldName = lcfirst(\Doctrine\Common\Util\Inflector::classify($by)); |
@@ -33,6 +33,6 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public static function noDispatchForNode($node) |
| 35 | 35 | { |
| 36 | - return new self("Double-dispatch for node " . get_class($node) . " is not supported."); |
|
| 36 | + return new self("Double-dispatch for node ".get_class($node)." is not supported."); |
|
| 37 | 37 | } |
| 38 | 38 | } |
@@ -68,32 +68,32 @@ |
||
| 68 | 68 | $str = ''; |
| 69 | 69 | |
| 70 | 70 | if ($obj instanceof Node) { |
| 71 | - $str .= get_class($obj) . '(' . PHP_EOL; |
|
| 71 | + $str .= get_class($obj).'('.PHP_EOL; |
|
| 72 | 72 | $props = get_object_vars($obj); |
| 73 | 73 | |
| 74 | 74 | foreach ($props as $name => $prop) { |
| 75 | 75 | $ident += 4; |
| 76 | - $str .= str_repeat(' ', $ident) . '"' . $name . '": ' |
|
| 77 | - . $this->dump($prop) . ',' . PHP_EOL; |
|
| 76 | + $str .= str_repeat(' ', $ident).'"'.$name.'": ' |
|
| 77 | + . $this->dump($prop).','.PHP_EOL; |
|
| 78 | 78 | $ident -= 4; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - $str .= str_repeat(' ', $ident) . ')'; |
|
| 81 | + $str .= str_repeat(' ', $ident).')'; |
|
| 82 | 82 | } else if (is_array($obj)) { |
| 83 | 83 | $ident += 4; |
| 84 | 84 | $str .= 'array('; |
| 85 | 85 | $some = false; |
| 86 | 86 | |
| 87 | 87 | foreach ($obj as $k => $v) { |
| 88 | - $str .= PHP_EOL . str_repeat(' ', $ident) . '"' |
|
| 89 | - . $k . '" => ' . $this->dump($v) . ','; |
|
| 88 | + $str .= PHP_EOL.str_repeat(' ', $ident).'"' |
|
| 89 | + . $k.'" => '.$this->dump($v).','; |
|
| 90 | 90 | $some = true; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $ident -= 4; |
| 94 | - $str .= ($some ? PHP_EOL . str_repeat(' ', $ident) : '') . ')'; |
|
| 94 | + $str .= ($some ? PHP_EOL.str_repeat(' ', $ident) : '').')'; |
|
| 95 | 95 | } else if (is_object($obj)) { |
| 96 | - $str .= 'instanceof(' . get_class($obj) . ')'; |
|
| 96 | + $str .= 'instanceof('.get_class($obj).')'; |
|
| 97 | 97 | } else { |
| 98 | 98 | $str .= var_export($obj, true); |
| 99 | 99 | } |
@@ -44,9 +44,9 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) |
| 46 | 46 | { |
| 47 | - return 'ABS(' . $sqlWalker->walkSimpleArithmeticExpression( |
|
| 47 | + return 'ABS('.$sqlWalker->walkSimpleArithmeticExpression( |
|
| 48 | 48 | $this->simpleArithmeticExpression |
| 49 | - ) . ')'; |
|
| 49 | + ).')'; |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |