@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | public function __construct(array $values) |
| 35 | 35 | { |
| 36 | - if (!is_string($values['value'])) { |
|
| 36 | + if ( ! is_string($values['value'])) { |
|
| 37 | 37 | throw new RuntimeException('"value" must be a string.'); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $propertyName = $propertyMetadata->name; |
| 44 | 44 | if ($doctrineMetadata->hasField($propertyName) && $fieldType = $this->normalizeFieldType($doctrineMetadata->getTypeOfField($propertyName))) { |
| 45 | 45 | $field = $doctrineMetadata->getFieldMapping($propertyName); |
| 46 | - if (!empty($field['multivalue'])) { |
|
| 46 | + if ( ! empty($field['multivalue'])) { |
|
| 47 | 47 | $fieldType = 'array'; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
| 62 | + if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
| 63 | 63 | $targetEntity = "ArrayCollection<{$targetEntity}>"; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | public function __construct(array $values) |
| 32 | 32 | { |
| 33 | - if (!isset($values['value']) || !is_string($values['value'])) { |
|
| 33 | + if ( ! isset($values['value']) || ! is_string($values['value'])) { |
|
| 34 | 34 | throw new RuntimeException(sprintf('"value" must be a string.')); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | foreach ($data as $key => $value) { |
| 43 | - if (!property_exists(__CLASS__, $key)) { |
|
| 43 | + if ( ! property_exists(__CLASS__, $key)) { |
|
| 44 | 44 | throw new InvalidArgumentException(sprintf('Unknown property "%s" on annotation "%s".', $key, __CLASS__)); |
| 45 | 45 | } |
| 46 | 46 | $this->{$key} = $value; |
@@ -22,12 +22,12 @@ discard block |
||
| 22 | 22 | use Hoa\Compiler\Llk\Llk; |
| 23 | 23 | use Hoa\File\Read; |
| 24 | 24 | |
| 25 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
| 25 | +require __DIR__.'/../../vendor/autoload.php'; |
|
| 26 | 26 | |
| 27 | -$compiler = Llk::load(new Read(__DIR__ . '/grammar.pp')); |
|
| 27 | +$compiler = Llk::load(new Read(__DIR__.'/grammar.pp')); |
|
| 28 | 28 | |
| 29 | 29 | file_put_contents( |
| 30 | - __DIR__ . '/InnerParser.php', |
|
| 30 | + __DIR__.'/InnerParser.php', |
|
| 31 | 31 | <<<EOS |
| 32 | 32 | <?php |
| 33 | 33 | |
@@ -57,5 +57,5 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | |
| 59 | 59 | EOS |
| 60 | - . 'final ' . Llk::save($compiler, 'InnerParser') |
|
| 60 | + . 'final '.Llk::save($compiler, 'InnerParser') |
|
| 61 | 61 | ); |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | public function enableExternalEntities(bool $enable = true): self |
| 42 | 42 | { |
| 43 | - $this->disableExternalEntities = !$enable; |
|
| 43 | + $this->disableExternalEntities = ! $enable; |
|
| 44 | 44 | return $this; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | public function createDriver(array $metadataDirs, Reader $annotationReader): DriverInterface |
| 33 | 33 | { |
| 34 | - if (!empty($metadataDirs)) { |
|
| 34 | + if ( ! empty($metadataDirs)) { |
|
| 35 | 35 | $fileLocator = new FileLocator($metadataDirs); |
| 36 | 36 | |
| 37 | 37 | return new DriverChain([ |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function translateName(PropertyMetadata $property): string |
| 45 | 45 | { |
| 46 | - $name = preg_replace('/[A-Z]+/', $this->separator . '\\0', $property->name); |
|
| 46 | + $name = preg_replace('/[A-Z]+/', $this->separator.'\\0', $property->name); |
|
| 47 | 47 | |
| 48 | 48 | if ($this->lowerCase) { |
| 49 | 49 | return strtolower($name); |
@@ -70,15 +70,15 @@ discard block |
||
| 70 | 70 | if ($this->nestedGroups) { |
| 71 | 71 | $groups = $this->getGroupsFor($navigatorContext); |
| 72 | 72 | |
| 73 | - if (!$property->groups) { |
|
| 74 | - return !in_array(self::DEFAULT_GROUP, $groups); |
|
| 73 | + if ( ! $property->groups) { |
|
| 74 | + return ! in_array(self::DEFAULT_GROUP, $groups); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $this->shouldSkipUsingGroups($property, $groups); |
| 78 | 78 | } else { |
| 79 | 79 | |
| 80 | - if (!$property->groups) { |
|
| 81 | - return !isset($this->groups[self::DEFAULT_GROUP]); |
|
| 80 | + if ( ! $property->groups) { |
|
| 81 | + return ! isset($this->groups[self::DEFAULT_GROUP]); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | foreach ($property->groups as $group) { |
@@ -107,11 +107,11 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | $groups = $this->groups; |
| 109 | 109 | foreach ($paths as $index => $path) { |
| 110 | - if (!array_key_exists($path, $groups)) { |
|
| 110 | + if ( ! array_key_exists($path, $groups)) { |
|
| 111 | 111 | break; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - if (!is_array($groups[$path])) { |
|
| 114 | + if ( ! is_array($groups[$path])) { |
|
| 115 | 115 | throw new RuntimeException(sprintf('The group value for the property path "%s" should be an array, "%s" given', $index, gettype($groups[$path]))); |
| 116 | 116 | } |
| 117 | 117 | |