ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder Class Reference
+ Inheritance diagram for ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder:
+ Collaboration diagram for ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder:

Public Member Functions

 create (string $fqdn)
 
 defaultValueFor (object $object, string $method)
 Derives the value a mocked method returns when nothing was stubbed. More...
 
 create (string $fqdn)
 

Protected Member Functions

 loadGeneratedCode (string $code, string $generated_class)
 

Private Member Functions

 createLazyShell (string $type)
 
 createNormal (string $type)
 
 generate (string $type, string $generated_class)
 
 shouldOverride (ReflectionMethod $method)
 
 buildMethod (ReflectionMethod $method, array &$return_map)
 
 buildMethodAttributes (ReflectionMethod $method)
 
 needsReturnTypeWillChange (ReflectionMethod $method)
 
 buildMethodBody (string $method_name, ?ReflectionType $return_type)
 
 buildStaticMethodBody (string $method_name)
 Static methods have no instance to record the call on, they are only declared to satisfy the signature of the mocked type. More...
 
 buildParameterList (ReflectionMethod $method)
 
 buildParameter (ReflectionParameter $parameter)
 
 renderType (?ReflectionType $type)
 
 normalizeType (?ReflectionType $type)
 
 defaultByMeta (object $object, array $meta)
 
 generatedClassName (string $type)
 
 exportValue (mixed $value)
 

Detailed Description

Definition at line 35 of file AbstractLightMockBuilder.php.

Member Function Documentation

◆ buildMethod()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::buildMethod ( ReflectionMethod  $method,
array &  $return_map 
)
private
Parameters
array<string,mixed>$return_map

Definition at line 220 of file AbstractLightMockBuilder.php.

220 : string
221 {
222 $visibility = $method->isPublic() ? 'public' : 'protected';
223 $static = $method->isStatic() ? ' static' : '';
224 $name = $method->getName();
225 $params = $this->buildParameterList($method);
226 $return_type = $this->renderType($method->getReturnType());
227
228 $return_map[$name] = $this->normalizeType($method->getReturnType());
229
230 $body = $method->isStatic()
231 ? $this->buildStaticMethodBody($name)
232 : $this->buildMethodBody($name, $method->getReturnType());
233 $attribute = $this->buildMethodAttributes($method);
234
235 return trim(
236 $attribute .
237 sprintf(
238 '%s%s function %s(%s)%s %s',
239 $visibility,
240 $static,
241 $name,
242 $params,
243 $return_type !== '' ? ': ' . $return_type : '',
244 $body
245 )
246 );
247 }
buildMethodBody(string $method_name, ?ReflectionType $return_type)
buildStaticMethodBody(string $method_name)
Static methods have no instance to record the call on, they are only declared to satisfy the signatur...
$body
Definition: ltiauth.php:41

References $body, ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethodAttributes(), ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethodBody(), ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildParameterList(), ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildStaticMethodBody(), ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\normalizeType(), and ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\renderType().

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\generate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMethodAttributes()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::buildMethodAttributes ( ReflectionMethod  $method)
private

Definition at line 249 of file AbstractLightMockBuilder.php.

249 : string
250 {
251 if ($this->needsReturnTypeWillChange($method)) {
252 return "#[\\ReturnTypeWillChange]\n";
253 }
254
255 return '';
256 }

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\needsReturnTypeWillChange().

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildMethodBody()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::buildMethodBody ( string  $method_name,
?ReflectionType  $return_type 
)
private

Definition at line 285 of file AbstractLightMockBuilder.php.

285 : string
286 {
287 $normalized = $this->normalizeType($return_type);
288
289 if ($normalized['kind'] === 'never') {
290 return <<<PHP
291{
292 throw new \\LogicException('Mocked never-returning method called: {$method_name}');
293}
294PHP;
295 }
296
297 if ($normalized['kind'] === 'void') {
298 return <<<PHP
299{
300 \$this->__mockInvoke('{$method_name}', func_get_args());
301 return;
302}
303PHP;
304 }
305
306 return <<<PHP
307{
308 return \$this->__mockInvoke('{$method_name}', func_get_args());
309}
310PHP;
311 }

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\normalizeType().

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildParameter()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::buildParameter ( ReflectionParameter  $parameter)
private

Definition at line 337 of file AbstractLightMockBuilder.php.

337 : string
338 {
339 $code = '';
340
341 $type = $this->renderType($parameter->getType());
342 if ($type !== '') {
343 $code .= $type . ' ';
344 }
345
346 if ($parameter->isPassedByReference()) {
347 $code .= '&';
348 }
349
350 if ($parameter->isVariadic()) {
351 $code .= '...';
352 }
353
354 $code .= '$' . $parameter->getName();
355
356 if (!$parameter->isVariadic() && $parameter->isDefaultValueAvailable()) {
357 if ($parameter->isDefaultValueConstant()) {
358 $code .= ' = ' . $parameter->getDefaultValueConstantName();
359 } else {
360 $code .= ' = ' . $this->exportValue($parameter->getDefaultValue());
361 }
362 }
363
364 return $code;
365 }

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\exportValue(), and ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\renderType().

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildParameterList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildParameterList()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::buildParameterList ( ReflectionMethod  $method)
private

Definition at line 326 of file AbstractLightMockBuilder.php.

326 : string
327 {
328 $parts = [];
329
330 foreach ($method->getParameters() as $parameter) {
331 $parts[] = $this->buildParameter($parameter);
332 }
333
334 return implode(', ', $parts);
335 }

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildParameter().

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethod().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildStaticMethodBody()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::buildStaticMethodBody ( string  $method_name)
private

Static methods have no instance to record the call on, they are only declared to satisfy the signature of the mocked type.

Definition at line 317 of file AbstractLightMockBuilder.php.

317 : string
318 {
319 return <<<PHP
320{
321 throw new \\LogicException('Static methods of mocks cannot be called: {$method_name}');
322}
323PHP;
324 }

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethod().

+ Here is the caller graph for this function:

◆ create()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::create ( string  $fqdn)
Parameters
string$typeFQDN of interface, class, ...
Returns
object Mock of this type

Implements ILIAS\Component\Dependencies\Mocks\MockBuilder.

Definition at line 76 of file AbstractLightMockBuilder.php.

76 : object
77 {
78 if (interface_exists($fqdn)) {
79 return $this->createNormal($fqdn);
80 }
81
82 try {
83 return $this->createLazyShell($fqdn);
84 } catch (LogicException | \ReflectionException) {
85 return $this->createNormal($fqdn);
86 }
87 }

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\createLazyShell(), and ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\createNormal().

+ Here is the call graph for this function:

◆ createLazyShell()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::createLazyShell ( string  $type)
private

Definition at line 37 of file AbstractLightMockBuilder.php.

37 : object
38 {
39 if (!class_exists($type)) {
40 throw new LogicException(
41 "Lazy-shell mocks only support concrete or abstract classes, not interfaces/unknown types: {$type}"
42 );
43 }
44
45 $ref = new ReflectionClass($type);
46
47 if ($ref->isInterface()) {
48 throw new LogicException("Lazy-shell mocks do not support interfaces: {$type}");
49 }
50
51 if ($ref->isTrait()) {
52 throw new LogicException("Traits cannot be mocked directly: {$type}");
53 }
54
55 if ($ref->isEnum()) {
56 throw new LogicException("Enums cannot be mocked: {$type}");
57 }
58
59 if ($ref->isFinal()) {
60 throw new LogicException("Final classes cannot be mocked without extensions/code rewriting: {$type}");
61 }
62
63 if ($ref->isAbstract()) {
64 throw new LogicException("Abstract classes cannot be instantiated as a lazy shell: {$type}");
65 }
66
67 return $ref->newLazyGhost(
68 static function (object $object): void {
69 // Intentionally left blank.
70 // This variant is only meant to provide a typed shell object.
71 },
72 ReflectionClass::SKIP_INITIALIZATION_ON_SERIALIZE
73 );
74 }

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\create().

+ Here is the caller graph for this function:

◆ createNormal()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::createNormal ( string  $type)
private

Definition at line 89 of file AbstractLightMockBuilder.php.

89 : object
90 {
91 $generated_class = $this->generatedClassName($type);
92 $generated_fqcn = __NAMESPACE__ . '\\' . $generated_class;
93
94 if (!GeneratedMockRegistry::isGenerated($generated_fqcn)) {
95 GeneratedMockRegistry::register($generated_fqcn, $this->generate($type, $generated_class), $this);
96 }
97
98 return new $generated_fqcn();
99 }
static register(string $generated_fqcn, array $return_types, AbstractLightMockBuilder $builder)

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\generate(), ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\generatedClassName(), ILIAS\Component\Dependencies\Mocks\GeneratedMockRegistry\isGenerated(), and ILIAS\Component\Dependencies\Mocks\GeneratedMockRegistry\register().

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\create(), and ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\defaultByMeta().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defaultByMeta()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::defaultByMeta ( object  $object,
array  $meta 
)
private
Parameters
array<string,mixed>$meta

Definition at line 475 of file AbstractLightMockBuilder.php.

475 : mixed
476 {
477 $kind = $meta['kind'] ?? 'none';
478
479 if ($kind === 'none') {
480 return null;
481 }
482
483 if ($kind === 'void') {
484 return null;
485 }
486
487 if ($kind === 'never') {
488 throw new LogicException('Cannot produce a default value for return type never');
489 }
490
491 if ($kind === 'intersection') {
492 throw new LogicException('Intersection return types need explicit stubbing');
493 }
494
495 if ($kind === 'union') {
496 foreach ($meta['types'] as $sub_type) {
497 if (($sub_type['kind'] ?? null) === 'named' && ($sub_type['name'] ?? null) === 'null') {
498 return null;
499 }
500 }
501
502 foreach ($meta['types'] as $sub_type) {
503 if (($sub_type['kind'] ?? null) === 'named' && ($sub_type['name'] ?? null) !== 'null') {
504 return $this->defaultByMeta($object, $sub_type);
505 }
506 }
507
508 return null;
509 }
510
511 $name = $meta['name'] ?? null;
512 $nullable = (bool) ($meta['nullable'] ?? false);
513
514 if ($nullable) {
515 return null;
516 }
517
518 return match ($name) {
519 'void' => null,
520 'never' => throw new LogicException('Cannot return from a never-returning method'),
521 'null' => null,
522 'mixed' => null,
523 'bool', 'false' => false,
524 'true' => true,
525 'int' => 0,
526 'float' => 0.0,
527 'string' => '',
528 'array' => [],
529 'iterable' => [],
530 'callable' => static fn(): null => null,
531 'object' => new \stdClass(),
532 'self', 'static' => $object,
533 'parent' => $this->createNormal((string) get_parent_class($object)),
534 default => $this->createNormal($name),
535 };
536 }

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\createNormal(), and ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\defaultByMeta().

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\defaultByMeta(), and ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\defaultValueFor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defaultValueFor()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::defaultValueFor ( object  $object,
string  $method 
)

Derives the value a mocked method returns when nothing was stubbed.

Called through {

See also
GeneratedMockRegistry::defaultValueFor()}.

Definition at line 460 of file AbstractLightMockBuilder.php.

460 : mixed
461 {
462 $meta = GeneratedMockRegistry::returnTypeFor($object::class, $method);
463
464 if ($meta === null) {
465 // a method this builder never saw
466 return null;
467 }
468
469 return $this->defaultByMeta($object, $meta);
470 }
static returnTypeFor(string $generated_fqcn, string $method)

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\defaultByMeta(), and ILIAS\Component\Dependencies\Mocks\GeneratedMockRegistry\returnTypeFor().

+ Here is the call graph for this function:

◆ exportValue()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::exportValue ( mixed  $value)
private

Definition at line 543 of file AbstractLightMockBuilder.php.

543 : string
544 {
545 return var_export($value, true);
546 }

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildParameter().

+ Here is the caller graph for this function:

◆ generate()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::generate ( string  $type,
string  $generated_class 
)
private
Returns
array<string, array<string, mixed>> method name => normalized return type

Definition at line 104 of file AbstractLightMockBuilder.php.

104 : array
105 {
106 if (!class_exists($type) && !interface_exists($type)) {
107 throw new LogicException("Unknown class or interface: {$type}");
108 }
109
110 $ref = new ReflectionClass($type);
111
112 if ($ref->isEnum()) {
113 throw new LogicException("Enums cannot be mocked: {$type}");
114 }
115
116 if ($ref->isTrait()) {
117 throw new LogicException("Traits cannot be mocked directly: {$type}");
118 }
119
120 if ($ref->isFinal()) {
121 throw new LogicException("Final classes cannot be mocked without extensions/code rewriting: {$type}");
122 }
123
124 $method_code = [];
125 $return_map = [];
126
127 if ($ref->isInterface()) {
128 foreach ($ref->getMethods() as $method) {
129 if ($method->returnsReference()) {
130 throw new LogicException(
131 "Methods returning by reference are not supported by this lightweight mock builder: "
132 . $ref->getName() . "::" . $method->getName()
133 );
134 }
135
136 $method_code[] = $this->buildMethod($method, $return_map);
137 }
138
139 $header = "class {$generated_class} implements \\" . ltrim($type, '\\');
140 } else {
141 // only add an empty constructor if the parent constructor is not final
142 $constructor = $ref->getConstructor();
143 if ($constructor === null || !$constructor->isFinal()) {
144 $method_code[] = "public function __construct(...\$__args) {}";
145 }
146
147 foreach ($ref->getMethods() as $method) {
148 if (!$this->shouldOverride($method)) {
149 continue;
150 }
151
152 if ($method->returnsReference()) {
153 throw new LogicException(
154 "Methods returning by reference are not supported by this lightweight mock builder: "
155 . $ref->getName() . "::" . $method->getName()
156 );
157 }
158
159 $method_code[] = $this->buildMethod($method, $return_map);
160 }
161
162 $header = "class {$generated_class} extends \\" . ltrim($type, '\\');
163 }
164
165 $code = <<<PHP
167
168{$header}
169{
171
172 %s
173}
174PHP;
175
176 $code = sprintf($code, implode("\n\n", $method_code));
177
178 $this->loadGeneratedCode($code, $generated_class);
179
180 return $return_map;
181 }
loadGeneratedCode(string $code, string $generated_class)
buildMethod(ReflectionMethod $method, array &$return_map)

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethod(), ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\loadGeneratedCode(), ILIAS\Component\Dependencies\Mocks\MockObjectBehavior, and ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\shouldOverride().

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\createNormal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generatedClassName()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::generatedClassName ( string  $type)
private

Definition at line 538 of file AbstractLightMockBuilder.php.

538 : string
539 {
540 return 'Mock_' . md5($type);
541 }

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\createNormal().

+ Here is the caller graph for this function:

◆ loadGeneratedCode()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::loadGeneratedCode ( string  $code,
string  $generated_class 
)
abstractprotected

◆ needsReturnTypeWillChange()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::needsReturnTypeWillChange ( ReflectionMethod  $method)
private

Definition at line 258 of file AbstractLightMockBuilder.php.

258 : bool
259 {
260 if ($method->hasReturnType()) {
261 return false;
262 }
263
264 if (method_exists($method, 'hasTentativeReturnType') && $method->hasTentativeReturnType()) {
265 return true;
266 }
267
268 try {
269 $prototype = $method->getPrototype();
270
271 if ($prototype->hasReturnType()) {
272 return false;
273 }
274
275 if (method_exists($prototype, 'hasTentativeReturnType') && $prototype->hasTentativeReturnType()) {
276 return true;
277 }
278 } catch (\ReflectionException) {
279 // No prototype available.
280 }
281
282 return false;
283 }

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethodAttributes().

+ Here is the caller graph for this function:

◆ normalizeType()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::normalizeType ( ?ReflectionType  $type)
private
Returns
array<string, mixed>

Definition at line 408 of file AbstractLightMockBuilder.php.

408 : array
409 {
410 if ($type === null) {
411 return ['kind' => 'none'];
412 }
413
414 if ($type instanceof ReflectionNamedType) {
415 $name = $type->getName();
416
417 if ($name === 'void') {
418 return ['kind' => 'void'];
419 }
420
421 if ($name === 'never') {
422 return ['kind' => 'never'];
423 }
424
425 return [
426 'kind' => 'named',
427 'name' => $name,
428 'builtin' => $type->isBuiltin(),
429 'nullable' => $type->allowsNull(),
430 ];
431 }
432
433 if ($type instanceof ReflectionUnionType) {
434 return [
435 'kind' => 'union',
436 'types' => array_map(
437 $this->normalizeType(...),
438 $type->getTypes()
439 ),
440 ];
441 }
442
443 if ($type instanceof ReflectionIntersectionType) {
444 return [
445 'kind' => 'intersection',
446 'types' => array_map(
447 $this->normalizeType(...),
448 $type->getTypes()
449 ),
450 ];
451 }
452
453 throw new LogicException('Unsupported reflection type: ' . $type::class);
454 }

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\normalizeType().

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethod(), ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethodBody(), and ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\normalizeType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderType()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::renderType ( ?ReflectionType  $type)
private

Definition at line 367 of file AbstractLightMockBuilder.php.

367 : string
368 {
369 if ($type === null) {
370 return '';
371 }
372
373 if ($type instanceof ReflectionNamedType) {
374 $name = $type->getName();
375 $prefix = !$type->isBuiltin() && $name !== 'self' && $name !== 'parent' && $name !== 'static'
376 ? '\\'
377 : '';
378
379 if ($type->allowsNull() && $name !== 'mixed' && $name !== 'null') {
380 return '?' . $prefix . $name;
381 }
382
383 return $prefix . $name;
384 }
385
386 if ($type instanceof ReflectionUnionType) {
387 $parts = [];
388 foreach ($type->getTypes() as $sub_type) {
389 $parts[] = $this->renderType($sub_type);
390 }
391 return implode('|', $parts);
392 }
393
394 if ($type instanceof ReflectionIntersectionType) {
395 $parts = [];
396 foreach ($type->getTypes() as $sub_type) {
397 $parts[] = $this->renderType($sub_type);
398 }
399 return implode('&', $parts);
400 }
401
402 throw new LogicException('Unsupported reflection type: ' . $type::class);
403 }

References ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\renderType().

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildMethod(), ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\buildParameter(), and ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\renderType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shouldOverride()

ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder::shouldOverride ( ReflectionMethod  $method)
private

Definition at line 185 of file AbstractLightMockBuilder.php.

185 : bool
186 {
187 if ($method->isConstructor()) {
188 return false;
189 }
190
191 if ($method->isDestructor()) {
192 return false;
193 }
194
195 if ($method->isFinal()) {
196 return false;
197 }
198
199 if ($method->isPrivate()) {
200 return false;
201 }
202
203 if ($method->isStatic()) {
204 // an abstract static method must be declared, otherwise the class cannot be generated
205 return $method->isAbstract();
206 }
207 // only methods that can visibly be overridden in the target class or its parents
208 if ($method->isPublic()) {
209 return true;
210 }
211 if ($method->isProtected()) {
212 return true;
213 }
214 return $method->isAbstract();
215 }

Referenced by ILIAS\Component\Dependencies\Mocks\AbstractLightMockBuilder\generate().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: