forked from neos/flow-development-collection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap-phpstan.php
37 lines (32 loc) · 1.3 KB
/
bootstrap-phpstan.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* This bootstrap helps phpstan to detect all available constants
*/
namespace {
$_SERVER['FLOW_ROOTPATH'] = dirname(__DIR__, 2);
new \Neos\Flow\Core\Bootstrap('Testing');
}
// FIXME flow has no dependency on Neos.Media. This code should be extracted. https://github.com/neos/flow-development-collection/issues/3272
// Theses stubs below allow phpstan to work correctly, if Neos is not installed while linting.
namespace Neos\Media\Domain\Repository {
if (!class_exists(AssetRepository::class)) {
/**
* @method iterable<int, \Neos\Media\Domain\Model\AssetInterface> findByResource(\Neos\Flow\ResourceManagement\PersistentResource $resource)
* @method void removeWithoutUsageChecks(\Neos\Media\Domain\Model\AssetInterface $object)
*/
class AssetRepository extends \Neos\Flow\Persistence\Repository
{
}
}
}
namespace Neos\Media\Domain\Repository {
if (!class_exists(ThumbnailRepository::class)) {
/**
* @method iterable<int,\Neos\Media\Domain\Model\Thumbnail> findByResource(\Neos\Flow\ResourceManagement\PersistentResource $resource)
* @method void remove(\Neos\Media\Domain\Model\Thumbnail $object)
*/
class ThumbnailRepository extends \Neos\Flow\Persistence\Repository
{
}
}
}