Passed
Push — master ( 72934f...dfb406 )
by Aleksei
05:59 queued 26s
created
src/Security/src/Traits/GuardedTrait.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     public function getGuard(): GuardInterface
21 21
     {
22 22
         $container = ContainerScope::getContainer();
23
-        if (empty($container) || !$container->has(GuardInterface::class)) {
23
+        if (empty($container) || !$container->has(GuardInterface::class)){
24 24
             throw new ScopeException(
25 25
                 'Unable to get `GuardInterface`, binding is missing or container scope is not set'
26 26
             );
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
      */
45 45
     protected function resolvePermission(string $permission): string
46 46
     {
47
-        if (\defined('static::GUARD_NAMESPACE')) {
47
+        if (\defined('static::GUARD_NAMESPACE')){
48 48
             // Yay! Isolation
49
-            $permission = \constant(static::class . '::' . 'GUARD_NAMESPACE') . '.' . $permission;
49
+            $permission = \constant(static::class.'::'.'GUARD_NAMESPACE').'.'.$permission;
50 50
         }
51 51
 
52 52
         return $permission;
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@  discard block
 block discarded – undo
20 20
     public function getGuard(): GuardInterface
21 21
     {
22 22
         $container = ContainerScope::getContainer();
23
-        if (empty($container) || !$container->has(GuardInterface::class)) {
23
+        if (empty($container) || !$container->has(GuardInterface::class))
24
+        {
24 25
             throw new ScopeException(
25 26
                 'Unable to get `GuardInterface`, binding is missing or container scope is not set'
26 27
             );
@@ -44,7 +45,8 @@  discard block
 block discarded – undo
44 45
      */
45 46
     protected function resolvePermission(string $permission): string
46 47
     {
47
-        if (\defined('static::GUARD_NAMESPACE')) {
48
+        if (\defined('static::GUARD_NAMESPACE'))
49
+        {
48 50
             // Yay! Isolation
49 51
             $permission = \constant(static::class . '::' . 'GUARD_NAMESPACE') . '.' . $permission;
50 52
         }
Please login to merge, or discard this patch.
src/Security/src/Rule.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     public function __construct(
39 39
         protected ResolverInterface $resolver
40
-    ) {
40
+    ){
41 41
     }
42 42
 
43 43
     /**
@@ -48,20 +48,20 @@  discard block
 block discarded – undo
48 48
         $parameters = \compact('actor', 'permission', 'context') + $context;
49 49
 
50 50
         //Mounting aliases
51
-        foreach (static::ALIASES as $target => $alias) {
51
+        foreach (static::ALIASES as $target => $alias){
52 52
             $parameters[$target] = $parameters[$alias];
53 53
         }
54 54
 
55
-        try {
55
+        try{
56 56
             $method = new \ReflectionMethod($this, static::CHECK_METHOD);
57
-        } catch (\ReflectionException $e) {
57
+        }catch (\ReflectionException $e){
58 58
             throw new RuleException($e->getMessage(), $e->getCode(), $e);
59 59
         }
60 60
 
61
-        try {
61
+        try{
62 62
             return $method->invokeArgs($this, $this->resolver->resolveArguments($method, $parameters));
63
-        } catch (\Throwable $e) {
64
-            throw new RuleException(\sprintf('[%s] %s', $this::class, $e->getMessage()), (int) $e->getCode(), $e);
63
+        }catch (\Throwable $e){
64
+            throw new RuleException(\sprintf('[%s] %s', $this::class, $e->getMessage()), (int)$e->getCode(), $e);
65 65
         }
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,19 +48,26 @@
 block discarded – undo
48 48
         $parameters = \compact('actor', 'permission', 'context') + $context;
49 49
 
50 50
         //Mounting aliases
51
-        foreach (static::ALIASES as $target => $alias) {
51
+        foreach (static::ALIASES as $target => $alias)
52
+        {
52 53
             $parameters[$target] = $parameters[$alias];
53 54
         }
54 55
 
55
-        try {
56
+        try
57
+        {
56 58
             $method = new \ReflectionMethod($this, static::CHECK_METHOD);
57
-        } catch (\ReflectionException $e) {
59
+        }
60
+        catch (\ReflectionException $e)
61
+        {
58 62
             throw new RuleException($e->getMessage(), $e->getCode(), $e);
59 63
         }
60 64
 
61
-        try {
65
+        try
66
+        {
62 67
             return $method->invokeArgs($this, $this->resolver->resolveArguments($method, $parameters));
63
-        } catch (\Throwable $e) {
68
+        }
69
+        catch (\Throwable $e)
70
+        {
64 71
             throw new RuleException(\sprintf('[%s] %s', $this::class, $e->getMessage()), (int) $e->getCode(), $e);
65 72
         }
66 73
     }
Please login to merge, or discard this patch.
src/Security/src/Command/RolePermissionsCommand.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,16 +28,16 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $role = $this->argument('role');
30 30
 
31
-        if ($role !== null && !$rbac->hasRole($role)) {
31
+        if ($role !== null && !$rbac->hasRole($role)){
32 32
             throw new CommandException('Unknown role provided');
33 33
         }
34 34
 
35
-        if ($role !== null) {
35
+        if ($role !== null){
36 36
             $rows = $this->getRolePermissions($role, $rbac);
37
-        } else {
37
+        }else{
38 38
             $rows = [];
39 39
 
40
-            foreach ($rbac->getRoles() as $role) {
40
+            foreach ($rbac->getRoles() as $role){
41 41
                 /** @noinspection SlowArrayOperationsInLoopInspection */
42 42
                 $rows = \array_merge(
43 43
                     $this->getRolePermissions($role, $rbac),
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $permissions = [];
65 65
 
66
-        foreach ($rbac->getPermissions($role) as $permission => $rule) {
66
+        foreach ($rbac->getPermissions($role) as $permission => $rule){
67 67
             $permissions[] = [
68 68
                 'role' => $role,
69 69
                 'permission' => $permission,
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -28,16 +28,21 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $role = $this->argument('role');
30 30
 
31
-        if ($role !== null && !$rbac->hasRole($role)) {
31
+        if ($role !== null && !$rbac->hasRole($role))
32
+        {
32 33
             throw new CommandException('Unknown role provided');
33 34
         }
34 35
 
35
-        if ($role !== null) {
36
+        if ($role !== null)
37
+        {
36 38
             $rows = $this->getRolePermissions($role, $rbac);
37
-        } else {
39
+        }
40
+        else
41
+        {
38 42
             $rows = [];
39 43
 
40
-            foreach ($rbac->getRoles() as $role) {
44
+            foreach ($rbac->getRoles() as $role)
45
+            {
41 46
                 /** @noinspection SlowArrayOperationsInLoopInspection */
42 47
                 $rows = \array_merge(
43 48
                     $this->getRolePermissions($role, $rbac),
@@ -63,7 +68,8 @@  discard block
 block discarded – undo
63 68
     {
64 69
         $permissions = [];
65 70
 
66
-        foreach ($rbac->getPermissions($role) as $permission => $rule) {
71
+        foreach ($rbac->getPermissions($role) as $permission => $rule)
72
+        {
67 73
             $permissions[] = [
68 74
                 'role' => $role,
69 75
                 'permission' => $permission,
Please login to merge, or discard this patch.
src/Security/src/RuleManager.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -18,16 +18,16 @@  discard block
 block discarded – undo
18 18
 
19 19
     public function __construct(
20 20
         private readonly ContainerInterface $container
21
-    ) {
21
+    ){
22 22
     }
23 23
 
24 24
     public function set(string $name, mixed $rule = null): RuleManager
25 25
     {
26
-        if (empty($rule)) {
26
+        if (empty($rule)){
27 27
             $rule = $name;
28 28
         }
29 29
 
30
-        if (!$this->validateRule($rule)) {
30
+        if (!$this->validateRule($rule)){
31 31
             throw new RuleException("Unable to set rule '{$name}', invalid rule body");
32 32
         }
33 33
 
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
     public function remove(string $name): RuleManager
40 40
     {
41
-        if (!$this->has($name)) {
41
+        if (!$this->has($name)){
42 42
             throw new RuleException("Undefined rule '{$name}'");
43 43
         }
44 44
 
@@ -60,26 +60,26 @@  discard block
 block discarded – undo
60 60
 
61 61
     public function get(string $name): RuleInterface
62 62
     {
63
-        if (!$this->has($name)) {
63
+        if (!$this->has($name)){
64 64
             throw new RuleException(\sprintf("Undefined rule '%s'", $name));
65 65
         }
66 66
 
67
-        if (!isset($this->rules[$name])) {
67
+        if (!isset($this->rules[$name])){
68 68
             //Rule represented as class name
69 69
             $rule = $name;
70
-        } else {
70
+        }else{
71 71
             $rule = $this->rules[$name];
72 72
         }
73 73
 
74
-        if ($rule instanceof RuleInterface) {
74
+        if ($rule instanceof RuleInterface){
75 75
             return $rule;
76 76
         }
77 77
 
78
-        if (\is_string($rule)) {
78
+        if (\is_string($rule)){
79 79
             //We are expecting that rule points to
80 80
             $rule = $this->container->get($rule);
81 81
 
82
-            if (!$rule instanceof RuleInterface) {
82
+            if (!$rule instanceof RuleInterface){
83 83
                 throw new RuleException(\sprintf(
84 84
                     "Rule '%s' must point to RuleInterface, '%s' given",
85 85
                     $name,
@@ -99,18 +99,18 @@  discard block
 block discarded – undo
99 99
      */
100 100
     private function validateRule(mixed $rule): bool
101 101
     {
102
-        if ($rule instanceof \Closure || $rule instanceof RuleInterface) {
102
+        if ($rule instanceof \Closure || $rule instanceof RuleInterface){
103 103
             return true;
104 104
         }
105 105
 
106
-        if (\is_array($rule)) {
106
+        if (\is_array($rule)){
107 107
             return \is_callable($rule, true);
108 108
         }
109 109
 
110
-        if (\is_string($rule) && \class_exists($rule)) {
111
-            try {
110
+        if (\is_string($rule) && \class_exists($rule)){
111
+            try{
112 112
                 $reflection = new \ReflectionClass($rule);
113
-            } catch (\ReflectionException) {
113
+            }catch (\ReflectionException){
114 114
                 return false;
115 115
             }
116 116
 
Please login to merge, or discard this patch.
Braces   +30 added lines, -14 removed lines patch added patch discarded remove patch
@@ -23,11 +23,13 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function set(string $name, mixed $rule = null): RuleManager
25 25
     {
26
-        if (empty($rule)) {
26
+        if (empty($rule))
27
+        {
27 28
             $rule = $name;
28 29
         }
29 30
 
30
-        if (!$this->validateRule($rule)) {
31
+        if (!$this->validateRule($rule))
32
+        {
31 33
             throw new RuleException("Unable to set rule '{$name}', invalid rule body");
32 34
         }
33 35
 
@@ -38,7 +40,8 @@  discard block
 block discarded – undo
38 40
 
39 41
     public function remove(string $name): RuleManager
40 42
     {
41
-        if (!$this->has($name)) {
43
+        if (!$this->has($name))
44
+        {
42 45
             throw new RuleException("Undefined rule '{$name}'");
43 46
         }
44 47
 
@@ -60,26 +63,33 @@  discard block
 block discarded – undo
60 63
 
61 64
     public function get(string $name): RuleInterface
62 65
     {
63
-        if (!$this->has($name)) {
66
+        if (!$this->has($name))
67
+        {
64 68
             throw new RuleException(\sprintf("Undefined rule '%s'", $name));
65 69
         }
66 70
 
67
-        if (!isset($this->rules[$name])) {
71
+        if (!isset($this->rules[$name]))
72
+        {
68 73
             //Rule represented as class name
69 74
             $rule = $name;
70
-        } else {
75
+        }
76
+        else
77
+        {
71 78
             $rule = $this->rules[$name];
72 79
         }
73 80
 
74
-        if ($rule instanceof RuleInterface) {
81
+        if ($rule instanceof RuleInterface)
82
+        {
75 83
             return $rule;
76 84
         }
77 85
 
78
-        if (\is_string($rule)) {
86
+        if (\is_string($rule))
87
+        {
79 88
             //We are expecting that rule points to
80 89
             $rule = $this->container->get($rule);
81 90
 
82
-            if (!$rule instanceof RuleInterface) {
91
+            if (!$rule instanceof RuleInterface)
92
+            {
83 93
                 throw new RuleException(\sprintf(
84 94
                     "Rule '%s' must point to RuleInterface, '%s' given",
85 95
                     $name,
@@ -99,18 +109,24 @@  discard block
 block discarded – undo
99 109
      */
100 110
     private function validateRule(mixed $rule): bool
101 111
     {
102
-        if ($rule instanceof \Closure || $rule instanceof RuleInterface) {
112
+        if ($rule instanceof \Closure || $rule instanceof RuleInterface)
113
+        {
103 114
             return true;
104 115
         }
105 116
 
106
-        if (\is_array($rule)) {
117
+        if (\is_array($rule))
118
+        {
107 119
             return \is_callable($rule, true);
108 120
         }
109 121
 
110
-        if (\is_string($rule) && \class_exists($rule)) {
111
-            try {
122
+        if (\is_string($rule) && \class_exists($rule))
123
+        {
124
+            try
125
+            {
112 126
                 $reflection = new \ReflectionClass($rule);
113
-            } catch (\ReflectionException) {
127
+            }
128
+            catch (\ReflectionException)
129
+            {
114 130
                 return false;
115 131
             }
116 132
 
Please login to merge, or discard this patch.
src/Queue/tests/Config/QueueConfigTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -281,7 +281,7 @@
 block discarded – undo
281 281
         yield [['defaultSerializer' => null], null];
282 282
         yield [['defaultSerializer' => 'json'], 'json'];
283 283
         yield [['defaultSerializer' => JsonSerializer::class], JsonSerializer::class];
284
-        yield [['defaultSerializer' => new JsonSerializer ()], new JsonSerializer()];
284
+        yield [['defaultSerializer' => new JsonSerializer()], new JsonSerializer()];
285 285
         yield [['defaultSerializer' => new Autowire(JsonSerializer::class)], new Autowire(JsonSerializer::class)];
286 286
     }
287 287
 }
Please login to merge, or discard this patch.
src/Queue/src/Config/QueueConfig.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function getDefaultDriver(): string
66 66
     {
67
-        if (!\is_string($this->config['default'])) {
67
+        if (!\is_string($this->config['default'])){
68 68
             throw new InvalidArgumentException('Default queue connection config value must be a string');
69 69
         }
70 70
 
@@ -86,14 +86,14 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $connections = $this->config['connections'] ?? [];
88 88
 
89
-        if ($driver === null) {
89
+        if ($driver === null){
90 90
             return $connections;
91 91
         }
92 92
 
93 93
         $driverAliases = $this->getDriverAliases();
94 94
 
95
-        if (isset($driverAliases[$driver])) {
96
-            if (!\is_string($this->config['driverAliases'][$driver])) {
95
+        if (isset($driverAliases[$driver])){
96
+            if (!\is_string($this->config['driverAliases'][$driver])){
97 97
                 throw new InvalidArgumentException(
98 98
                     \sprintf('Driver alias for `%s` value must be a string', $driver)
99 99
                 );
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         }
104 104
 
105 105
         return \array_filter($connections, static function (array $connection) use ($driverAliases, $driver): bool {
106
-            if (empty($connection['driver'])) {
106
+            if (empty($connection['driver'])){
107 107
                 return false;
108 108
             }
109 109
 
@@ -121,28 +121,28 @@  discard block
 block discarded – undo
121 121
     {
122 122
         $connections = $this->getConnections();
123 123
 
124
-        if (!isset($connections[$name])) {
124
+        if (!isset($connections[$name])){
125 125
             throw new InvalidArgumentException(sprintf('Queue connection with given name `%s` is not defined.', $name));
126 126
         }
127 127
 
128
-        if (!isset($connections[$name]['driver'])) {
128
+        if (!isset($connections[$name]['driver'])){
129 129
             throw new InvalidArgumentException(\sprintf('Driver for queue connection `%s` is not defined.', $name));
130 130
         }
131 131
 
132 132
         $connection = $connections[$name];
133 133
         $driver = $connection['driver'];
134 134
 
135
-        if (!\is_string($driver)) {
135
+        if (!\is_string($driver)){
136 136
             throw new InvalidArgumentException(
137 137
                 \sprintf('Driver for queue connection `%s` value must be a string', $name)
138 138
             );
139 139
         }
140 140
 
141
-        if (isset($this->config['driverAliases'][$driver])) {
141
+        if (isset($this->config['driverAliases'][$driver])){
142 142
             $connection['driver'] = $this->config['driverAliases'][$driver];
143 143
         }
144 144
 
145
-        if (!\is_string($connection['driver'])) {
145
+        if (!\is_string($connection['driver'])){
146 146
             throw new InvalidArgumentException(
147 147
                 \sprintf('Driver alias for queue connection `%s` value must be a string', $name)
148 148
             );
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     /**
168 168
      * @psalm-return SerializerInterface|class-string|Autowire|null
169 169
      */
170
-    public function getDefaultSerializer(): SerializerInterface|string|Autowire|null
170
+    public function getDefaultSerializer(): SerializerInterface | string | Autowire | null
171 171
     {
172 172
         return $this->config['defaultSerializer'] ?? null;
173 173
     }
Please login to merge, or discard this patch.
Braces   +20 added lines, -10 removed lines patch added patch discarded remove patch
@@ -64,7 +64,8 @@  discard block
 block discarded – undo
64 64
      */
65 65
     public function getDefaultDriver(): string
66 66
     {
67
-        if (!\is_string($this->config['default'])) {
67
+        if (!\is_string($this->config['default']))
68
+        {
68 69
             throw new InvalidArgumentException('Default queue connection config value must be a string');
69 70
         }
70 71
 
@@ -86,14 +87,17 @@  discard block
 block discarded – undo
86 87
     {
87 88
         $connections = $this->config['connections'] ?? [];
88 89
 
89
-        if ($driver === null) {
90
+        if ($driver === null)
91
+        {
90 92
             return $connections;
91 93
         }
92 94
 
93 95
         $driverAliases = $this->getDriverAliases();
94 96
 
95
-        if (isset($driverAliases[$driver])) {
96
-            if (!\is_string($this->config['driverAliases'][$driver])) {
97
+        if (isset($driverAliases[$driver]))
98
+        {
99
+            if (!\is_string($this->config['driverAliases'][$driver]))
100
+            {
97 101
                 throw new InvalidArgumentException(
98 102
                     \sprintf('Driver alias for `%s` value must be a string', $driver)
99 103
                 );
@@ -103,7 +107,8 @@  discard block
 block discarded – undo
103 107
         }
104 108
 
105 109
         return \array_filter($connections, static function (array $connection) use ($driverAliases, $driver): bool {
106
-            if (empty($connection['driver'])) {
110
+            if (empty($connection['driver']))
111
+            {
107 112
                 return false;
108 113
             }
109 114
 
@@ -121,28 +126,33 @@  discard block
 block discarded – undo
121 126
     {
122 127
         $connections = $this->getConnections();
123 128
 
124
-        if (!isset($connections[$name])) {
129
+        if (!isset($connections[$name]))
130
+        {
125 131
             throw new InvalidArgumentException(sprintf('Queue connection with given name `%s` is not defined.', $name));
126 132
         }
127 133
 
128
-        if (!isset($connections[$name]['driver'])) {
134
+        if (!isset($connections[$name]['driver']))
135
+        {
129 136
             throw new InvalidArgumentException(\sprintf('Driver for queue connection `%s` is not defined.', $name));
130 137
         }
131 138
 
132 139
         $connection = $connections[$name];
133 140
         $driver = $connection['driver'];
134 141
 
135
-        if (!\is_string($driver)) {
142
+        if (!\is_string($driver))
143
+        {
136 144
             throw new InvalidArgumentException(
137 145
                 \sprintf('Driver for queue connection `%s` value must be a string', $name)
138 146
             );
139 147
         }
140 148
 
141
-        if (isset($this->config['driverAliases'][$driver])) {
149
+        if (isset($this->config['driverAliases'][$driver]))
150
+        {
142 151
             $connection['driver'] = $this->config['driverAliases'][$driver];
143 152
         }
144 153
 
145
-        if (!\is_string($connection['driver'])) {
154
+        if (!\is_string($connection['driver']))
155
+        {
146 156
             throw new InvalidArgumentException(
147 157
                 \sprintf('Driver alias for queue connection `%s` value must be a string', $name)
148 158
             );
Please login to merge, or discard this patch.
src/Queue/src/QueueRegistry.php 2 patches
Spacing   +12 added lines, -14 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
         private readonly ContainerInterface $container,
27 27
         private readonly FactoryInterface $factory,
28 28
         private readonly HandlerRegistryInterface $fallbackHandlers
29
-    ) {
29
+    ){
30 30
     }
31 31
 
32 32
     /**
33 33
      * Associate specific job type with handler class or object
34 34
      */
35
-    public function setHandler(string $jobType, HandlerInterface|string $handler): void
35
+    public function setHandler(string $jobType, HandlerInterface | string $handler): void
36 36
     {
37 37
         $this->handlers[$jobType] = $handler;
38 38
     }
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function getHandler(string $jobType): HandlerInterface
45 45
     {
46
-        if (isset($this->handlers[$jobType])) {
47
-            if ($this->handlers[$jobType] instanceof HandlerInterface) {
46
+        if (isset($this->handlers[$jobType])){
47
+            if ($this->handlers[$jobType] instanceof HandlerInterface){
48 48
                 return $this->handlers[$jobType];
49 49
             }
50 50
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      *
62 62
      * @throws InvalidArgumentException
63 63
      */
64
-    public function setSerializer(string $jobType, SerializerInterface|string|Autowire $serializer): void
64
+    public function setSerializer(string $jobType, SerializerInterface | string | Autowire $serializer): void
65 65
     {
66 66
         $this->serializers[$jobType] = $this->resolveSerializer($serializer);
67 67
     }
@@ -71,15 +71,14 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function getSerializer(?string $jobType = null): SerializerInterface
73 73
     {
74
-        if ($jobType && $this->hasSerializer($jobType)) {
74
+        if ($jobType && $this->hasSerializer($jobType)){
75 75
             return $this->serializers[$jobType];
76 76
         }
77 77
 
78 78
         $config = $this->container->get(QueueConfig::class);
79 79
 
80 80
         return $config->getDefaultSerializer() === null ?
81
-            $this->container->get(SerializerManager::class)->getSerializer() :
82
-            $this->resolveSerializer($config->getDefaultSerializer());
81
+            $this->container->get(SerializerManager::class)->getSerializer() : $this->resolveSerializer($config->getDefaultSerializer());
83 82
     }
84 83
 
85 84
     public function hasSerializer(string $jobType): bool
@@ -92,22 +91,21 @@  discard block
 block discarded – undo
92 91
      *
93 92
      * @throws InvalidArgumentException
94 93
      */
95
-    private function resolveSerializer(SerializerInterface|string|Autowire $serializer): SerializerInterface
94
+    private function resolveSerializer(SerializerInterface | string | Autowire $serializer): SerializerInterface
96 95
     {
97
-        if ($serializer instanceof Autowire) {
96
+        if ($serializer instanceof Autowire){
98 97
             $serializer = $serializer->resolve($this->factory);
99 98
         }
100 99
 
101
-        if (\is_string($serializer)) {
100
+        if (\is_string($serializer)){
102 101
             $registry = $this->container->get(SerializerRegistryInterface::class);
103 102
             \assert($registry instanceof SerializerRegistryInterface);
104 103
 
105 104
             $serializer = $registry->has($serializer) ?
106
-                $registry->get($serializer) :
107
-                $this->container->get($serializer);
105
+                $registry->get($serializer) : $this->container->get($serializer);
108 106
         }
109 107
 
110
-        if (!$serializer instanceof SerializerInterface) {
108
+        if (!$serializer instanceof SerializerInterface){
111 109
             throw new InvalidArgumentException(\sprintf(
112 110
                 'Serializer must be an instance of `SerializerInterface` but `%s` given.',
113 111
                 \get_debug_type($serializer)
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,8 +43,10 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function getHandler(string $jobType): HandlerInterface
45 45
     {
46
-        if (isset($this->handlers[$jobType])) {
47
-            if ($this->handlers[$jobType] instanceof HandlerInterface) {
46
+        if (isset($this->handlers[$jobType]))
47
+        {
48
+            if ($this->handlers[$jobType] instanceof HandlerInterface)
49
+            {
48 50
                 return $this->handlers[$jobType];
49 51
             }
50 52
 
@@ -71,7 +73,8 @@  discard block
 block discarded – undo
71 73
      */
72 74
     public function getSerializer(?string $jobType = null): SerializerInterface
73 75
     {
74
-        if ($jobType && $this->hasSerializer($jobType)) {
76
+        if ($jobType && $this->hasSerializer($jobType))
77
+        {
75 78
             return $this->serializers[$jobType];
76 79
         }
77 80
 
@@ -94,11 +97,13 @@  discard block
 block discarded – undo
94 97
      */
95 98
     private function resolveSerializer(SerializerInterface|string|Autowire $serializer): SerializerInterface
96 99
     {
97
-        if ($serializer instanceof Autowire) {
100
+        if ($serializer instanceof Autowire)
101
+        {
98 102
             $serializer = $serializer->resolve($this->factory);
99 103
         }
100 104
 
101
-        if (\is_string($serializer)) {
105
+        if (\is_string($serializer))
106
+        {
102 107
             $registry = $this->container->get(SerializerRegistryInterface::class);
103 108
             \assert($registry instanceof SerializerRegistryInterface);
104 109
 
@@ -107,7 +112,8 @@  discard block
 block discarded – undo
107 112
                 $this->container->get($serializer);
108 113
         }
109 114
 
110
-        if (!$serializer instanceof SerializerInterface) {
115
+        if (!$serializer instanceof SerializerInterface)
116
+        {
111 117
             throw new InvalidArgumentException(\sprintf(
112 118
                 'Serializer must be an instance of `SerializerInterface` but `%s` given.',
113 119
                 \get_debug_type($serializer)
Please login to merge, or discard this patch.
src/Queue/src/Exception/RetryException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
     public function __construct(
12 12
         string $reason = '',
13 13
         private ?OptionsInterface $options = null
14
-    ) {
14
+    ){
15 15
         parent::__construct($reason);
16 16
     }
17 17
 
Please login to merge, or discard this patch.
src/Queue/src/ContainerRegistry.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,19 +16,19 @@
 block discarded – undo
16 16
 
17 17
     public function __construct(
18 18
         private readonly ContainerInterface $container
19
-    ) {
19
+    ){
20 20
         $this->inflector = (new InflectorFactory())->build();
21 21
     }
22 22
 
23 23
     public function getHandler(string $jobType): HandlerInterface
24 24
     {
25
-        try {
25
+        try{
26 26
             $handler = $this->container->get($this->className($jobType));
27
-        } catch (ContainerException $e) {
27
+        }catch (ContainerException $e){
28 28
             throw new JobException($e->getMessage(), $e->getCode(), $e);
29 29
         }
30 30
 
31
-        if (!$handler instanceof HandlerInterface) {
31
+        if (!$handler instanceof HandlerInterface){
32 32
             throw new JobException(\sprintf('Unable to resolve job handler for `%s`', $jobType));
33 33
         }
34 34
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,13 +22,17 @@
 block discarded – undo
22 22
 
23 23
     public function getHandler(string $jobType): HandlerInterface
24 24
     {
25
-        try {
25
+        try
26
+        {
26 27
             $handler = $this->container->get($this->className($jobType));
27
-        } catch (ContainerException $e) {
28
+        }
29
+        catch (ContainerException $e)
30
+        {
28 31
             throw new JobException($e->getMessage(), $e->getCode(), $e);
29 32
         }
30 33
 
31
-        if (!$handler instanceof HandlerInterface) {
34
+        if (!$handler instanceof HandlerInterface)
35
+        {
32 36
             throw new JobException(\sprintf('Unable to resolve job handler for `%s`', $jobType));
33 37
         }
34 38
 
Please login to merge, or discard this patch.