@@ -67,6 +67,9 @@ discard block |
||
67 | 67 | return $return === $entity ? $this : $return; |
68 | 68 | } |
69 | 69 | |
70 | + /** |
|
71 | + * @param string $property |
|
72 | + */ |
|
70 | 73 | protected function inaccessible($property) |
71 | 74 | { |
72 | 75 | throw new \DomainException(sprintf( |
@@ -75,6 +78,9 @@ discard block |
||
75 | 78 | )); |
76 | 79 | } |
77 | 80 | |
81 | + /** |
|
82 | + * @param string $property |
|
83 | + */ |
|
78 | 84 | protected function immutable($property) |
79 | 85 | { |
80 | 86 | throw new ImmutablePropertyException($property, $this); |
@@ -58,7 +58,7 @@ |
||
58 | 58 | if (!is_callable($callback)) { |
59 | 59 | throw new \BadMethodCallException(sprintf( |
60 | 60 | 'Proxy error: Method "%s" does not exist in proxied "%s"', |
61 | - $method, get_class($entity) |
|
61 | + $method, get_class($entity) |
|
62 | 62 | )); |
63 | 63 | } |
64 | 64 |
@@ -140,12 +140,12 @@ |
||
140 | 140 | public function findLatest($sourceId, $isDraft = false) |
141 | 141 | { |
142 | 142 | return $this->createQueryBuilder() |
143 | - ->field('snapshotMeta.entity.$id')->equals(new \MongoId($sourceId)) |
|
144 | - ->field('snapshotMeta.isDraft')->equals($isDraft) |
|
145 | - ->sort('snapshotMeta.dateCreated.date', 'desc') |
|
146 | - ->limit(1) |
|
147 | - ->getQuery() |
|
148 | - ->getSingleResult(); |
|
143 | + ->field('snapshotMeta.entity.$id')->equals(new \MongoId($sourceId)) |
|
144 | + ->field('snapshotMeta.isDraft')->equals($isDraft) |
|
145 | + ->sort('snapshotMeta.dateCreated.date', 'desc') |
|
146 | + ->limit(1) |
|
147 | + ->getQuery() |
|
148 | + ->getSingleResult(); |
|
149 | 149 | |
150 | 150 | } |
151 | 151 |
@@ -189,7 +189,7 @@ |
||
189 | 189 | |
190 | 190 | protected function checkEntityType($entity) |
191 | 191 | { |
192 | - if ( !is_a($entity, $this->getDocumentName()) ) { |
|
192 | + if (!is_a($entity, $this->getDocumentName())) { |
|
193 | 193 | throw new \InvalidArgumentException(sprintf( |
194 | 194 | 'Entity must be of type %s but recieved %s instead', |
195 | 195 | $this->getDocumentName(), |
@@ -31,7 +31,7 @@ |
||
31 | 31 | public function setMetaData($key, $value = null) |
32 | 32 | { |
33 | 33 | if (is_array($key)) { |
34 | - $this->metaData = $key; |
|
34 | + $this->metaData = $key; |
|
35 | 35 | |
36 | 36 | } else { |
37 | 37 | $this->metaData[$key] = $value; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | use EntityTrait, ClonePropertiesTrait; |
30 | 30 | |
31 | - private $cloneProperties = [ '!items' ]; |
|
31 | + private $cloneProperties = ['!items']; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * The leafs. |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $parent = $nextParent; |
113 | 113 | } |
114 | 114 | $nameParts[] = $item->getName(); |
115 | - $items[] = join(' | ' , $nameParts); |
|
115 | + $items[] = join(' | ', $nameParts); |
|
116 | 116 | |
117 | 117 | } |
118 | 118 |
@@ -89,7 +89,7 @@ |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | if (!$target) { |
92 | - $target = get_class($source) . 'Snapshot'; |
|
92 | + $target = get_class($source).'Snapshot'; |
|
93 | 93 | $target = new $target($source); |
94 | 94 | } |
95 | 95 |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | |
53 | 53 | public function __construct($status = self::CREATED) |
54 | 54 | { |
55 | - $constant = 'self::' . strtoupper(str_replace(' ', '_', $status)); |
|
55 | + $constant = 'self::'.strtoupper(str_replace(' ', '_', $status)); |
|
56 | 56 | if (!defined($constant)) { |
57 | - throw new \DomainException('Unknown status: ' . $status); |
|
57 | + throw new \DomainException('Unknown status: '.$status); |
|
58 | 58 | } |
59 | - $this->name=constant($constant); |
|
60 | - $this->order=$this->getOrder(); |
|
59 | + $this->name = constant($constant); |
|
60 | + $this->order = $this->getOrder(); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function getName() |
68 | 68 | { |
69 | - return isset($this->name)?$this->name:''; |
|
69 | + return isset($this->name) ? $this->name : ''; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $collection->add(clone $item); |
48 | 48 | } |
49 | 49 | $value = $collection; |
50 | - } elseif(null === $value) { |
|
50 | + } elseif (null === $value) { |
|
51 | 51 | |
52 | 52 | } else { |
53 | 53 | $value = clone $value; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | public function init() |
46 | 46 | { |
47 | - $this->setAttribute('id','jobs-list-filter'); |
|
47 | + $this->setAttribute('id', 'jobs-list-filter'); |
|
48 | 48 | $this->setOption('text_span', 5); |
49 | 49 | parent::init(); |
50 | 50 | $this->setButtonElement('q'); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | ), |
84 | 84 | 'attributes' => [ |
85 | 85 | 'value' => '10', // default distance |
86 | - 'data-searchbox' => -1, // hide the search box |
|
86 | + 'data-searchbox' => -1, // hide the search box |
|
87 | 87 | 'data-allowclear' => 'false', // allow to clear a selected value |
88 | 88 | 'data-placeholder' => /*@translate*/ 'Distance', |
89 | 89 | 'data-width' => '100%', |
@@ -46,10 +46,8 @@ |
||
46 | 46 | * |
47 | 47 | * Proxies to {@link get()} |
48 | 48 | * |
49 | - * @param string|array $elementsFieldset |
|
50 | - * @param null|string $buttonsFieldset |
|
51 | 49 | * |
52 | - * @return \Core\Form\TextSearchForm |
|
50 | + * @return \Core\Form\SearchForm |
|
53 | 51 | */ |
54 | 52 | public function __invoke($form, $options = null, $params = null) |
55 | 53 | { |
@@ -72,11 +72,11 @@ |
||
72 | 72 | public function get($form, $options = null, $params = null) |
73 | 73 | { |
74 | 74 | if (!is_object($form)) { |
75 | - $form = $this->formElementManager->get($form, $options); |
|
75 | + $form = $this->formElementManager->get($form, $options); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** @noinspection PhpUndefinedMethodInspection */ |
79 | - $params = $params ?: $this->getController()->getRequest()->getQuery(); |
|
79 | + $params = $params ?: $this->getController()->getRequest()->getQuery(); |
|
80 | 80 | |
81 | 81 | /* I tried using form methods (bind, isValid)... |
82 | 82 | * but because the search form could be in an invalidated state |