@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public function findByAssignedPermissionsResourceId($resourceId) |
70 | 70 | { |
71 | 71 | $criteria = $this->getIsDeletedCriteria( |
72 | - ['permissions.assigned.' . $resourceId => [ '$exists' => true]] |
|
72 | + ['permissions.assigned.'.$resourceId => ['$exists' => true]] |
|
73 | 73 | ); |
74 | 74 | |
75 | 75 | return $this->findBy($criteria); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $qb = $this->createQueryBuilder(); |
141 | 141 | $qb->distinct('organization') |
142 | 142 | ->hydrate(true) |
143 | - ->field('status.name')->notIn([ StatusInterface::EXPIRED, StatusInterface::INACTIVE ]); |
|
143 | + ->field('status.name')->notIn([StatusInterface::EXPIRED, StatusInterface::INACTIVE]); |
|
144 | 144 | |
145 | 145 | $q = $qb->getQuery(); |
146 | 146 | $r = $q->execute(); |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | $qb->field('_id')->in($r); |
151 | 151 | if ($term) { |
152 | 152 | $qb->field('_organizationName') |
153 | - ->equals(new Regex('/' . addslashes($term) . '/i')); |
|
153 | + ->equals(new Regex('/'.addslashes($term).'/i')); |
|
154 | 154 | } |
155 | 155 | |
156 | - if($execute){ |
|
156 | + if ($execute) { |
|
157 | 157 | return $qb->getQuery()->execute(); |
158 | 158 | } |
159 | 159 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function createQueryBuilder($isDeleted = false): QueryBuilder |
230 | 230 | { |
231 | - $qb = parent::createQueryBuilder(); |
|
231 | + $qb = parent::createQueryBuilder(); |
|
232 | 232 | |
233 | 233 | if (null !== $isDeleted) { |
234 | 234 | $qb->addAnd( |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $repo = $this->getDoctrine()->getRepository(Organization::class); |
54 | 54 | $org = $repo->findOneBy(['_organizationName' => $name]); |
55 | 55 | |
56 | - if(is_null($org)){ |
|
56 | + if (is_null($org)) { |
|
57 | 57 | $org = new Organization(); |
58 | 58 | $org->setOrganizationName(new OrganizationName($name)); |
59 | 59 | $this->getDoctrine()->persist($org); |
@@ -62,71 +62,71 @@ |
||
62 | 62 | $parent = new Organization(); |
63 | 63 | $permissions = $this->createMock(Permissions::class); |
64 | 64 | return [ |
65 | - [ 'externalId', '1234' ], |
|
66 | - [ 'name', [ 'value'=> '', 'ignore_setter' => true] ], |
|
67 | - [ 'name', [ 'pre' => 'setupGetName', 'value' => 'Test', 'ignore_setter' => true] ], |
|
68 | - [ 'organizationName' , [ |
|
69 | - '@value' => [ '\Organizations\Entity\OrganizationName', [ 'Test' ] ], |
|
65 | + ['externalId', '1234'], |
|
66 | + ['name', ['value'=> '', 'ignore_setter' => true]], |
|
67 | + ['name', ['pre' => 'setupGetName', 'value' => 'Test', 'ignore_setter' => true]], |
|
68 | + ['organizationName', [ |
|
69 | + '@value' => ['\Organizations\Entity\OrganizationName', ['Test']], |
|
70 | 70 | 'post' => 'organizationNamePostAsserts' |
71 | 71 | ]], |
72 | - [ 'organizationName', [ |
|
72 | + ['organizationName', [ |
|
73 | 73 | 'pre' => 'setupOrganizationName', |
74 | - '@value' => [ '\Organizations\Entity\OrganizationName', [ 'TestNew' ] ], |
|
74 | + '@value' => ['\Organizations\Entity\OrganizationName', ['TestNew']], |
|
75 | 75 | 'post' => 'assertOrganizationNameCounter' |
76 | 76 | ]], |
77 | - [ 'permissions',[ |
|
77 | + ['permissions', [ |
|
78 | 78 | 'value' => $permissions |
79 | 79 | ]], |
80 | - [ 'images',[ |
|
80 | + ['images', [ |
|
81 | 81 | 'value' => new ImageSet(), |
82 | 82 | ]], |
83 | - [ 'isDraft',[ |
|
83 | + ['isDraft', [ |
|
84 | 84 | 'default' => false, |
85 | 85 | 'value' => true, |
86 | 86 | 'getter_method' => 'isDraft' |
87 | 87 | ]], |
88 | - [ 'contact',[ |
|
88 | + ['contact', [ |
|
89 | 89 | 'value' => new OrganizationContact() |
90 | 90 | ]], |
91 | - [ 'description',[ |
|
91 | + ['description', [ |
|
92 | 92 | 'default' => null, |
93 | 93 | 'value' => 'Some Description' |
94 | 94 | ]], |
95 | - [ 'parent',[ |
|
95 | + ['parent', [ |
|
96 | 96 | 'default' => null, |
97 | 97 | 'value' => $parent, |
98 | 98 | ]], |
99 | - [ 'hiringOrganizations',[ |
|
99 | + ['hiringOrganizations', [ |
|
100 | 100 | 'default' => null, |
101 | 101 | ]], |
102 | 102 | |
103 | - [ 'employees',[ |
|
103 | + ['employees', [ |
|
104 | 104 | '@default' => ArrayCollection::class, |
105 | 105 | 'value' => new ArrayCollection() |
106 | 106 | ]], |
107 | 107 | |
108 | - [ 'jobs',[ |
|
108 | + ['jobs', [ |
|
109 | 109 | 'default' => null, |
110 | 110 | ]], |
111 | 111 | |
112 | - [ 'user',[ |
|
112 | + ['user', [ |
|
113 | 113 | 'value' => new User() |
114 | 114 | ]], |
115 | 115 | |
116 | - [ 'template',[ |
|
116 | + ['template', [ |
|
117 | 117 | 'value' => new Template(), |
118 | 118 | ]], |
119 | 119 | |
120 | - [ 'workflowSettings',[ |
|
120 | + ['workflowSettings', [ |
|
121 | 121 | 'value' => new WorkflowSettings(), |
122 | 122 | ]], |
123 | 123 | |
124 | - [ 'profileSetting',[ |
|
124 | + ['profileSetting', [ |
|
125 | 125 | 'value' => Organization::PROFILE_ALWAYS_ENABLE, |
126 | 126 | 'default' => null, |
127 | 127 | ]], |
128 | 128 | |
129 | - [ 'hydrator', [ |
|
129 | + ['hydrator', [ |
|
130 | 130 | '@default' => EntityHydrator::class |
131 | 131 | ]] |
132 | 132 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | public function testGetUriWithAndWithoutFilename() |
50 | 50 | { |
51 | - $filename="My File.png"; |
|
51 | + $filename = "My File.png"; |
|
52 | 52 | $this->target->setName($filename); |
53 | 53 | $this->assertSame($this->target->getUri(), '/file/Organizations.OrganizationImage/'.$this->target->getId().'/'.urlencode($this->target->getName())); |
54 | 54 |
@@ -78,7 +78,7 @@ |
||
78 | 78 | $builder->expects($this->any()) |
79 | 79 | ->method('field') |
80 | 80 | ->willReturnMap([ |
81 | - ['permissions.view',$builder] |
|
81 | + ['permissions.view', $builder] |
|
82 | 82 | ]) |
83 | 83 | ; |
84 | 84 |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | $this->fileManager = $this->createMock(FileManager::class); |
85 | 85 | |
86 | - $this->listener = new ApplicationListener($this->cacheManager,$this->fileManager); |
|
86 | + $this->listener = new ApplicationListener($this->cacheManager, $this->fileManager); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | { |
167 | 167 | $baseUrl = '/base'; |
168 | 168 | $path = '/some/uri'; |
169 | - $uri = $baseUrl . $path; |
|
169 | + $uri = $baseUrl.$path; |
|
170 | 170 | $this->event->setError(Application::ERROR_ROUTER_NO_MATCH); |
171 | 171 | |
172 | 172 | $this->request->expects($this->once()) |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | { |
202 | 202 | $id = 'someId'; |
203 | 203 | $ext = 'ext'; |
204 | - $name = 'filename.' . $ext; |
|
204 | + $name = 'filename.'.$ext; |
|
205 | 205 | $path = sprintf('d/I/%s.%s', $id, $ext); |
206 | 206 | $resource = 'someResource'; |
207 | 207 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public function testMatchUri($uri, $expected) |
240 | 240 | { |
241 | - $this->assertSame($expected, $this->manager->matchUri($this->options->getUriPath() . $uri)); |
|
241 | + $this->assertSame($expected, $this->manager->matchUri($this->options->getUriPath().$uri)); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | 'view_manager' => [ |
67 | 67 | // Map template to files. Speeds up the lookup through the template stack. |
68 | 68 | 'template_map' => [ |
69 | - 'organizations/index/edit' => __DIR__ . '/../view/organizations/index/form.phtml', |
|
70 | - 'organizations/form/employees-fieldset' => __DIR__ . '/../view/form/employees-fieldset.phtml', |
|
71 | - 'organizations/form/employee-fieldset' => __DIR__ .'/../view/form/employee-fieldset.phtml', |
|
72 | - 'organizations/form/invite-employee-bar' => __DIR__ . '/../view/form/invite-employee-bar.phtml', |
|
73 | - 'organizations/error/no-parent' => __DIR__ . '/../view/error/no-parent.phtml', |
|
74 | - 'organizations/error/invite' => __DIR__ . '/../view/error/invite.phtml', |
|
75 | - 'organizations/mail/invite-employee' => __DIR__ . '/../view/mail/invite-employee.phtml', |
|
76 | - 'organizations/form/workflow-fieldset' => __DIR__ . '/../view/form/workflow-fieldset.phtml', |
|
69 | + 'organizations/index/edit' => __DIR__ . '/../view/organizations/index/form.phtml', |
|
70 | + 'organizations/form/employees-fieldset' => __DIR__ . '/../view/form/employees-fieldset.phtml', |
|
71 | + 'organizations/form/employee-fieldset' => __DIR__ .'/../view/form/employee-fieldset.phtml', |
|
72 | + 'organizations/form/invite-employee-bar' => __DIR__ . '/../view/form/invite-employee-bar.phtml', |
|
73 | + 'organizations/error/no-parent' => __DIR__ . '/../view/error/no-parent.phtml', |
|
74 | + 'organizations/error/invite' => __DIR__ . '/../view/error/invite.phtml', |
|
75 | + 'organizations/mail/invite-employee' => __DIR__ . '/../view/mail/invite-employee.phtml', |
|
76 | + 'organizations/form/workflow-fieldset' => __DIR__ . '/../view/form/workflow-fieldset.phtml', |
|
77 | 77 | 'organizations/profile/disabled' => __DIR__ . '/../view/organizations/profile/disabled.phtml', |
78 | 78 | ], |
79 | 79 | // Where to look for view templates not mapped above |
@@ -83,21 +83,21 @@ discard block |
||
83 | 83 | ], |
84 | 84 | 'form_elements' => [ |
85 | 85 | 'invokables' => [ |
86 | - 'Organizations/Form' => 'Organizations\Form\Organizations', |
|
87 | - 'Organizations/OrganizationsContactForm' => 'Organizations\Form\OrganizationsContactForm', |
|
88 | - 'Organizations/OrganizationsNameForm' => 'Organizations\Form\OrganizationsNameForm', |
|
89 | - 'Organizations/OrganizationsDescriptionForm' => 'Organizations\Form\OrganizationsDescriptionForm', |
|
90 | - 'Organizations/OrganizationsContactFieldset' => 'Organizations\Form\OrganizationsContactFieldset', |
|
91 | - 'Organizations/OrganizationsDescriptionFieldset' => 'Organizations\Form\OrganizationsDescriptionFieldset', |
|
92 | - //'Organizations/OrganizationFieldset' => 'Organizations\Form\OrganizationFieldset', |
|
93 | - 'Organizations/EmployeesContainer' => 'Organizations\Form\EmployeesContainer', |
|
94 | - 'Organizations/Employees' => 'Organizations\Form\Employees', |
|
95 | - 'Organizations/InviteEmployeeBar' => 'Organizations\Form\Element\InviteEmployeeBar', |
|
96 | - 'Organizations/Employee' => 'Organizations\Form\Element\Employee', |
|
97 | - 'Organizations/WorkflowSettings' => 'Organizations\Form\WorkflowSettings', |
|
98 | - 'Organizations/WorkflowSettingsFieldset' => 'Organizations\Form\WorkflowSettingsFieldset', |
|
99 | - 'Organizations/Profile' => \Organizations\Form\OrganizationsProfileForm::class, |
|
100 | - 'Organizations/ProfileFieldset' => \Organizations\Form\OrganizationsProfileFieldset::class |
|
86 | + 'Organizations/Form' => 'Organizations\Form\Organizations', |
|
87 | + 'Organizations/OrganizationsContactForm' => 'Organizations\Form\OrganizationsContactForm', |
|
88 | + 'Organizations/OrganizationsNameForm' => 'Organizations\Form\OrganizationsNameForm', |
|
89 | + 'Organizations/OrganizationsDescriptionForm' => 'Organizations\Form\OrganizationsDescriptionForm', |
|
90 | + 'Organizations/OrganizationsContactFieldset' => 'Organizations\Form\OrganizationsContactFieldset', |
|
91 | + 'Organizations/OrganizationsDescriptionFieldset' => 'Organizations\Form\OrganizationsDescriptionFieldset', |
|
92 | + //'Organizations/OrganizationFieldset' => 'Organizations\Form\OrganizationFieldset', |
|
93 | + 'Organizations/EmployeesContainer' => 'Organizations\Form\EmployeesContainer', |
|
94 | + 'Organizations/Employees' => 'Organizations\Form\Employees', |
|
95 | + 'Organizations/InviteEmployeeBar' => 'Organizations\Form\Element\InviteEmployeeBar', |
|
96 | + 'Organizations/Employee' => 'Organizations\Form\Element\Employee', |
|
97 | + 'Organizations/WorkflowSettings' => 'Organizations\Form\WorkflowSettings', |
|
98 | + 'Organizations/WorkflowSettingsFieldset' => 'Organizations\Form\WorkflowSettingsFieldset', |
|
99 | + 'Organizations/Profile' => \Organizations\Form\OrganizationsProfileForm::class, |
|
100 | + 'Organizations/ProfileFieldset' => \Organizations\Form\OrganizationsProfileFieldset::class |
|
101 | 101 | ], |
102 | 102 | 'factories' => [ |
103 | 103 | 'Organizations/OrganizationsNameFieldset' => \Organizations\Factory\Form\OrganizationsNameFieldsetFactory::class, |
@@ -212,13 +212,13 @@ discard block |
||
212 | 212 | |
213 | 213 | 'service_manager' => [ |
214 | 214 | 'invokables' => [ |
215 | - 'Organizations\Auth\Dependency\EmployeeListListener' => 'Organizations\Auth\Dependency\EmployeeListListener' |
|
215 | + 'Organizations\Auth\Dependency\EmployeeListListener' => 'Organizations\Auth\Dependency\EmployeeListListener' |
|
216 | 216 | ], |
217 | 217 | 'factories' => [ |
218 | - 'Organizations\Auth\Dependency\ListListener' => 'Organizations\Factory\Auth\Dependency\ListListenerFactory', |
|
219 | - 'Organizations\ImageFileCache\Manager' => 'Organizations\Factory\ImageFileCache\ManagerFactory', |
|
220 | - 'Organizations\ImageFileCache\ODMListener' => 'Organizations\Factory\ImageFileCache\ODMListenerFactory', |
|
221 | - 'Organizations\ImageFileCache\ApplicationListener' => 'Organizations\Factory\ImageFileCache\ApplicationListenerFactory', |
|
218 | + 'Organizations\Auth\Dependency\ListListener' => 'Organizations\Factory\Auth\Dependency\ListListenerFactory', |
|
219 | + 'Organizations\ImageFileCache\Manager' => 'Organizations\Factory\ImageFileCache\ManagerFactory', |
|
220 | + 'Organizations\ImageFileCache\ODMListener' => 'Organizations\Factory\ImageFileCache\ODMListenerFactory', |
|
221 | + 'Organizations\ImageFileCache\ApplicationListener' => 'Organizations\Factory\ImageFileCache\ApplicationListenerFactory', |
|
222 | 222 | \Organizations\Service\UploadHandler::class => [\Organizations\Service\UploadHandler::class, 'factory'], |
223 | 223 | ], |
224 | 224 | ], |
@@ -77,12 +77,12 @@ discard block |
||
77 | 77 | $imageSetID = $organization->getImages()->getId(); |
78 | 78 | $images = $imageSet->createImages($options->getImages(), $data); |
79 | 79 | |
80 | - if(!is_dir($tmpDir)){ |
|
80 | + if (!is_dir($tmpDir)) { |
|
81 | 81 | mkdir($tmpDir, 0777, true); |
82 | 82 | } |
83 | 83 | |
84 | - foreach($images as $key => $image){ |
|
85 | - $name = $key.'-'. $data['name']; |
|
84 | + foreach ($images as $key => $image) { |
|
85 | + $name = $key.'-'.$data['name']; |
|
86 | 86 | $format = str_replace('image/', '', $data['type']); |
87 | 87 | $content = $image->get($format); |
88 | 88 | $tmpFile = $tmpDir.DIRECTORY_SEPARATOR.md5($image->get($format)); |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | $metadata->setOrganization($organization); |
94 | 94 | $metadata->setKey($key); |
95 | 95 | $metadata->setContentType($data['type']); |
96 | - if(!is_null($user)){ |
|
96 | + if (!is_null($user)) { |
|
97 | 97 | $metadata->setUser($user); |
98 | 98 | } |
99 | 99 | |
100 | 100 | /* @var ImageInterface $file */ |
101 | - $file = $fileManager->uploadFromFile($options->getEntityClass(),$metadata, $tmpFile, $name); |
|
101 | + $file = $fileManager->uploadFromFile($options->getEntityClass(), $metadata, $tmpFile, $name); |
|
102 | 102 | $organization->getImages()->add($file); |
103 | 103 | } |
104 | 104 |