diff --git a/.gitattributes b/.gitattributes index 04182e7..079c2c1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,6 +3,6 @@ commands export-ignore .github/ export-ignore docker-compose.yml export-ignore entrypoint.sh export-ignore -app/.php-cs-fixer.dist.php export-ignore -app/phpstan.neon export-ignore -app/rector.php export-ignore \ No newline at end of file +.php-cs-fixer.dist.php export-ignore +phpstan.neon export-ignore +rector.php export-ignore \ No newline at end of file diff --git a/.github/workflows/format-code.yml b/.github/workflows/format-code.yml index 3d78e98..3d2fe9e 100644 --- a/.github/workflows/format-code.yml +++ b/.github/workflows/format-code.yml @@ -16,7 +16,6 @@ jobs: - uses: actions/checkout@v4 - name: Validate composer.json and composer.lock - working-directory: ./app run: composer validate - name: Cache Composer packages @@ -29,7 +28,6 @@ jobs: ${{ runner.os }}-php- - name: Install dependencies - working-directory: ./app run: composer install --prefer-dist --no-progress - name: format code diff --git a/.github/workflows/test-sw.yml b/.github/workflows/test-sw.yml index 37067f4..377f0ad 100644 --- a/.github/workflows/test-sw.yml +++ b/.github/workflows/test-sw.yml @@ -15,7 +15,6 @@ jobs: - uses: actions/checkout@v4 - name: Validate composer.json and composer.lock - working-directory: ./app run: composer validate - name: Cache Composer packages @@ -28,7 +27,6 @@ jobs: ${{ runner.os }}-php- - name: Install dependencies - working-directory: ./app run: composer install --prefer-dist --no-progress - name: Run test suite diff --git a/.gitignore b/.gitignore index 018874d..b55050a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ /nbproject/ /vendor/ -/app/nbproject/ -/app/vendor/ -/app/.php-cs-fixer.cache -/app/.phpdoc/ +/.php-cs-fixer.cache +/.phpdoc/ diff --git a/app/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php similarity index 100% rename from app/.php-cs-fixer.dist.php rename to .php-cs-fixer.dist.php diff --git a/Dockerfile b/Dockerfile index e24509c..ce69db7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,15 +18,15 @@ RUN echo "apc.enable_cli=1" >> /usr/local/etc/php/php.ini RUN echo "apc.enable=1" >> /usr/local/etc/php/php.ini WORKDIR /app -COPY app/composer.* ./ +COPY ./src ./src +COPY ./tests ./tests +COPY composer.* ./ RUN composer install --no-interaction --no-scripts --no-autoloader --prefer-dist -COPY ./app . - RUN composer dump-autoload --optimize COPY ./entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/entrypoint.sh -ENTRYPOINT ["entrypoint.sh"] +ENTRYPOINT ["entrypoint.sh"] \ No newline at end of file diff --git a/app/composer.json b/composer.json similarity index 100% rename from app/composer.json rename to composer.json diff --git a/app/composer.lock b/composer.lock similarity index 100% rename from app/composer.lock rename to composer.lock diff --git a/docker-compose.yml b/docker-compose.yml index 6ec752c..e26fbac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,14 @@ services: app: build: . volumes: - - ./app:/app + - ./src:/app/src + - ./tests:/app//tests + - ./vendor:/app/vendor + - ./composer.json:/app/composer.json + - ./composer.lock:/app/composer.lock + - ./rector.php:/app/rector.php + - ./phpstan.neon:/app/phpstan.neon + - ./.php-cs-fixer.dist.php:/app/.php-cs-fixer.dist.php networks: - cache-multi-layer-network depends_on: diff --git a/entrypoint.sh b/entrypoint.sh index 2941ff3..5f83165 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -3,6 +3,7 @@ case "$1" in 'test-sw') + composer install exec ./vendor/bin/phpunit ./tests/ ;; 'update-vendor') diff --git a/app/phpstan.neon b/phpstan.neon similarity index 100% rename from app/phpstan.neon rename to phpstan.neon diff --git a/app/rector.php b/rector.php similarity index 100% rename from app/rector.php rename to rector.php diff --git a/app/src/Enum/CacheEnum.php b/src/Enum/CacheEnum.php similarity index 100% rename from app/src/Enum/CacheEnum.php rename to src/Enum/CacheEnum.php diff --git a/app/src/Exception/CacheMissingConfigurationException.php b/src/Exception/CacheMissingConfigurationException.php similarity index 100% rename from app/src/Exception/CacheMissingConfigurationException.php rename to src/Exception/CacheMissingConfigurationException.php diff --git a/app/src/Interface/Cacheable.php b/src/Interface/Cacheable.php similarity index 100% rename from app/src/Interface/Cacheable.php rename to src/Interface/Cacheable.php diff --git a/app/src/Service/ApcuCache.php b/src/Service/ApcuCache.php similarity index 100% rename from app/src/Service/ApcuCache.php rename to src/Service/ApcuCache.php diff --git a/app/src/Service/Cache.php b/src/Service/Cache.php similarity index 100% rename from app/src/Service/Cache.php rename to src/Service/Cache.php diff --git a/app/src/Service/CacheConfiguration.php b/src/Service/CacheConfiguration.php similarity index 100% rename from app/src/Service/CacheConfiguration.php rename to src/Service/CacheConfiguration.php diff --git a/app/src/Service/CacheManager.php b/src/Service/CacheManager.php similarity index 100% rename from app/src/Service/CacheManager.php rename to src/Service/CacheManager.php diff --git a/app/src/Service/CacheManagerImpl.php b/src/Service/CacheManagerImpl.php similarity index 100% rename from app/src/Service/CacheManagerImpl.php rename to src/Service/CacheManagerImpl.php diff --git a/app/src/Service/CacheManagerImplDryMode.php b/src/Service/CacheManagerImplDryMode.php similarity index 100% rename from app/src/Service/CacheManagerImplDryMode.php rename to src/Service/CacheManagerImplDryMode.php diff --git a/app/src/Service/MemcacheCache.php b/src/Service/MemcacheCache.php similarity index 100% rename from app/src/Service/MemcacheCache.php rename to src/Service/MemcacheCache.php diff --git a/app/src/Service/RedisCache.php b/src/Service/RedisCache.php similarity index 100% rename from app/src/Service/RedisCache.php rename to src/Service/RedisCache.php diff --git a/app/tests/AbstractCache.php b/tests/AbstractCache.php similarity index 100% rename from app/tests/AbstractCache.php rename to tests/AbstractCache.php diff --git a/app/tests/AbstractCacheManager.php b/tests/AbstractCacheManager.php similarity index 100% rename from app/tests/AbstractCacheManager.php rename to tests/AbstractCacheManager.php diff --git a/app/tests/ApcuCacheTest.php b/tests/ApcuCacheTest.php similarity index 100% rename from app/tests/ApcuCacheTest.php rename to tests/ApcuCacheTest.php diff --git a/app/tests/CacheManagerDryRunTest.php b/tests/CacheManagerDryRunTest.php similarity index 100% rename from app/tests/CacheManagerDryRunTest.php rename to tests/CacheManagerDryRunTest.php diff --git a/app/tests/CacheManagerMultiLevelTest.php b/tests/CacheManagerMultiLevelTest.php similarity index 100% rename from app/tests/CacheManagerMultiLevelTest.php rename to tests/CacheManagerMultiLevelTest.php diff --git a/app/tests/CacheManagerOneLevelTest.php b/tests/CacheManagerOneLevelTest.php similarity index 100% rename from app/tests/CacheManagerOneLevelTest.php rename to tests/CacheManagerOneLevelTest.php diff --git a/app/tests/Entity/Foo.php b/tests/Entity/Foo.php similarity index 100% rename from app/tests/Entity/Foo.php rename to tests/Entity/Foo.php diff --git a/app/tests/MemcacheCacheTest.php b/tests/MemcacheCacheTest.php similarity index 100% rename from app/tests/MemcacheCacheTest.php rename to tests/MemcacheCacheTest.php diff --git a/app/tests/RedisCacheTest.php b/tests/RedisCacheTest.php similarity index 100% rename from app/tests/RedisCacheTest.php rename to tests/RedisCacheTest.php