Skip to content
Permalink
Browse files

Init

  • Loading branch information...
core23 committed Oct 20, 2018
0 parents commit 0acf1f4bd11ec7a83c3f71911bd1b817536b4fe9
Showing with 2,131 additions and 0 deletions.
  1. +23 −0 .editorconfig
  2. +6 −0 .gitattributes
  3. +48 −0 .github/ISSUE_TEMPLATE/Bug.md
  4. +8 −0 .github/ISSUE_TEMPLATE/Feature.md
  5. +8 −0 .github/ISSUE_TEMPLATE/Question.md
  6. +12 −0 .github/PULL_REQUEST_TEMPLATE.md
  7. +6 −0 .gitignore
  8. +58 −0 .php_cs.dist
  9. +33 −0 .rmt.yml
  10. +67 −0 .travis.yml
  11. +72 −0 Jenkinsfile
  12. +21 −0 LICENSE.md
  13. +22 −0 Makefile
  14. +75 −0 README.md
  15. +61 −0 composer.json
  16. +14 −0 phpstan.neon
  17. +16 −0 phpunit.xml.dist
  18. +43 −0 src/Action/SitemapXMLAction.php
  19. +27 −0 src/Core23SitemapBundle.php
  20. +52 −0 src/DependencyInjection/Compiler/SitemapCompilerPass.php
  21. +31 −0 src/DependencyInjection/Core23SitemapExtension.php
  22. +18 −0 src/Exception/SitemapNotFoundException.php
  23. +120 −0 src/Generator/SitemapGenerator.php
  24. +20 −0 src/Generator/SitemapGeneratorInterface.php
  25. +54 −0 src/Loader/ServiceLoader.php
  26. +27 −0 src/Loader/SitemapLoaderInterface.php
  27. +131 −0 src/Model/Sitemap.php
  28. +82 −0 src/Model/SitemapInterface.php
  29. +91 −0 src/Model/SitemapManager.php
  30. +58 −0 src/Model/SitemapManagerInterface.php
  31. +142 −0 src/Model/Url.php
  32. +63 −0 src/Model/UrlInterface.php
  33. +8 −0 src/Resources/config/action.xml
  34. +3 −0 src/Resources/config/routing/sitemap.yml
  35. +17 −0 src/Resources/config/services.xml
  36. +10 −0 src/Resources/config/sitemap.xml
  37. +87 −0 src/Sitemap/AbstractSitemapService.php
  38. +35 −0 src/Sitemap/SitemapServiceInterface.php
  39. +112 −0 src/Sitemap/SitemapServiceManager.php
  40. +53 −0 src/Sitemap/SitemapServiceManagerInterface.php
  41. +42 −0 src/Sitemap/StaticSitemapService.php
  42. +114 −0 src/Test/AbstractSitemapServiceTestCase.php
  43. +53 −0 tests/Sitemap/StaticSitemapServiceTest.php
  44. +35 −0 tests/autoload.php.dist
  45. +27 −0 tests/bootstrap.php
  46. +5 −0 vendor-bin/checker/composer.json
  47. +5 −0 vendor-bin/csfixer/composer.json
  48. +11 −0 vendor-bin/phpstan/composer.json
  49. +5 −0 vendor-bin/test/composer.json
@@ -0,0 +1,23 @@
root = true

[*]
end_of_line = lf
indent_style = space
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yaml,yml,twig,php}]
indent_size = 4

[*.{js,scss,css}]
indent_size = 2

[.travis.yml,Jenkinsfile]
indent_size = 2

[*.{json}]
indent_size = 4

[Makefile]
indent_style = tab
@@ -0,0 +1,6 @@
.* export-ignore
Makefile export-ignore
phpunit.xml.dist export-ignore
docs/* export-ignore
tests/* export-ignore
vendor-bin/ export-ignore
@@ -0,0 +1,48 @@
---
name: 🐞 Bug Report
about: Something is broken? 🔨
---

<!--
Before you open an issue, make sure this one does not already exist.
-->

<!--
If you are reporting a bug, please try to fill in the following.
Otherwise remove it.
-->

### Environment

#### Packages

```
$ composer show --latest
# Put the result here.
```

#### PHP version

```
$ php -v
# Put the result here.
```

## Subject

<!--
Give here as many details as possible.
Next sections are for ERRORS only.
-->

## Steps to reproduce

## Expected results

## Actual results

<!--
If it's an error message or piece of code, use code block tags,
and make sure you provide the whole stack trace(s),
not just the first error message you can see.
-->
@@ -0,0 +1,8 @@
---
name: 🚀 Feature Request
about: I have a suggestion (and may want to implement it)!
---

## Feature Request

<!-- Provide a summary of the feature. -->
@@ -0,0 +1,8 @@
---
name: ❓ Support Question
about: I have a general question 💬!
---

## Question


@@ -0,0 +1,12 @@
<!-- THE PR TEMPLATE IS NOT AN OPTION. DO NOT DELETE IT, MAKE SURE YOU READ AND EDIT IT! -->

<!--
Specify which issues will be fixed/closed.
Remove it if this is not related.
-->

Closes #{put_issue_number_here}

## Subject

<!-- Describe your Pull Request content here -->
@@ -0,0 +1,6 @@
build
phpunit.xml
coverage
composer.lock
vendor
.php_cs.cache
@@ -0,0 +1,58 @@
<?php
// try to get Symfony's PHPunit Bridge
$files = array_filter(array(
__DIR__.'/vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php',
__DIR__.'/../../../vendor/sllh/php-cs-fixer-styleci-bridge/autoload.php',
), 'file_exists');
if (count($files) > 0) {
require_once current($files);
}
use SLLH\StyleCIBridge\ConfigBridge;
$header = <<<EOF
(c) Christian Gripp <mail@core23.de>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;
$rules = [
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP70Migration' => true,
'@PHP71Migration:risky' => true,
'array_syntax' => [
'syntax' => 'short',
],
'binary_operator_spaces' => [
'default' => 'align',
],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'header_comment' => [
'header' => $header,
],
'no_extra_consecutive_blank_lines' => true,
'no_php4_constructor' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_order' => true,
'php_unit_strict' => true,
];
$finder = PhpCsFixer\Finder::create()
->in( __DIR__)
->exclude('tests/Fixtures')
;
return PhpCsFixer\Config::create()
->setFinder($finder)
->setRiskyAllowed(true)
->setRules($rules)
->setUsingCache(true)
;
@@ -0,0 +1,33 @@
vcs: git

prerequisites:
- working-copy-check
- display-last-changes
- composer-json-check:
composer: composer
- command:
cmd: composer update
- tests-check:
command: phpunit --stop-on-failure
- command:
cmd: vendor/bin/phpstan analyse -c phpstan.neon -l 7 src tests
- command:
cmd: vendor/bin/php-cs-fixer fix --verbose
- composer-security-check
- composer-stability-check
- command:
cmd: vendor/bin/composer-require-checker check composer.json
stop_on_error: false
- command:
cmd: git remote -v

pre-release-actions:
composer-update: ~
changelog-update:
format: simple
dump-commits: true
exclude-merge-commits: true
vcs-commit: ~

version-generator: semantic
version-persister: vcs-tag
@@ -0,0 +1,67 @@
language: php

php:
- 7.1
- 7.2
- nightly

sudo: false

addons:
apt:
packages:
- libxml2-utils

cache:
directories:
- $HOME/.composer/cache

env:
global:
- PATH="$HOME/.composer/vendor/bin:$PATH"
- SYMFONY_DEPRECATIONS_HELPER=weak_vendors
- TARGET=test

stages:
- lint
- dependencies
- test

matrix:
fast_finish: true
include:
- stage: lint
php: 7.2
env: TARGET=lint
- stage: lint
php: 7.2
env: TARGET=phpstan
- stage: dependencies
php: 7.2
env: TARGET=checkdeps
- stage: test
php: 7.1
env: COMPOSER_FLAGS="--prefer-lowest"
- stage: test
php: 7.2
env: SYMFONY_VERSION=3.4.*
- stage: test
php: 7.2
env: SYMFONY_VERSION=4.0.*
allow_failures:
- php: nightly
- php: 7.2
env: TARGET=checkdeps

before_install:
- wget "https://github.com/php-coveralls/php-coveralls/releases/download/v2.0.0/php-coveralls.phar" --output-document="${HOME}/bin/php-coveralls" && chmod u+x "${HOME}/bin/php-coveralls"
- gem install yaml-lint

install:
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
- composer update --prefer-dist --no-interaction $COMPOSER_FLAGS

script: make $TARGET

after_success:
- php-coveralls -v
@@ -0,0 +1,72 @@
pipeline {
agent {
label 'php7.1'
}

stages {
stage ('Checkout') {
steps {
checkout scm
}
}

stage ('Build') {
steps {
sh 'composer update'
}
}

stage ('Test') {
steps {
sh 'vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml --log-junit build/logs/phpunit.xml'
archive 'build/logs/*.xml'

step([
$class: 'XUnitBuilder', testTimeMargin: '3000', thresholdMode: 1,
thresholds: [
[$class: 'FailedThreshold', failureNewThreshold: '', failureThreshold: '0', unstableNewThreshold: '', unstableThreshold: ''],
[$class: 'SkippedThreshold', failureNewThreshold: '', failureThreshold: '', unstableNewThreshold: '', unstableThreshold: '']
],
tools: [[
$class: 'PHPUnitJunitHudsonTestType',
deleteOutputFiles: true,
failIfNotNew: true,
pattern: 'build/logs/phpunit.xml',
skipNoTestFiles: false,
stopProcessingIfError: true
]]
])

step([
$class: 'CloverPublisher',
cloverReportDir: 'build/logs/',
cloverReportFileName: 'clover.xml',
healthyTarget: [methodCoverage: 70, conditionalCoverage: 80, statementCoverage: 80],
unhealthyTarget: [methodCoverage: 50, conditionalCoverage: 50, statementCoverage: 50],
failingTarget: [methodCoverage: 0, conditionalCoverage: 0, statementCoverage: 0]
])
}
}

/* Temporary disabled
stage ('Deps') {
steps {
sh 'vendor/bin/composer-require-checker check composer.json'
}
}
*/

stage ('Lint') {
steps {
sh 'vendor/bin/php-cs-fixer fix --verbose'
sh 'composer validate'
}
}

stage ('Analyse') {
steps {
sh 'vendor/bin/phpstan analyse -c phpstan.neon -l 7 src tests'
}
}
}
}
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015-2018 Christian Gripp

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,22 @@
.PHONY: lint test

all:
@echo "Please choose a task."

lint:
composer validate
find . -name '*.yml' -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './src/Resources/public/vendor/*' | xargs yaml-lint
find . \( -name '*.xml' -or -name '*.xlf' \) \
-not -path './vendor/*' -not -path './vendor-bin/*' -not -path './src/Resources/public/vendor/*' \
| xargs -I'{}' xmllint --encode UTF-8 --output '{}' --format '{}'
vendor/bin/php-cs-fixer fix --verbose
git diff --exit-code

checkdeps:
vendor/bin/composer-require-checker check composer.json

phpstan:
vendor/bin/phpstan analyse -c phpstan.neon -l 7 src tests

test:
vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/logs/clover.xml

0 comments on commit 0acf1f4

Please sign in to comment.
You can’t perform that action at this time.