Skip to content

Commit 60b58f4

Browse files
committed
first commit
0 parents  commit 60b58f4

File tree

14 files changed

+435
-0
lines changed

14 files changed

+435
-0
lines changed

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/appveyor.yml export-ignore
2+
/.php_cs.dist export-ignore
3+
/phpstan.neon export-ignore
4+
/phpunit.xml.dist export-ignore
5+
/tests/ export-ignore
6+
/.travis.yml export-ignore
7+
/.gitignore export-ignore
8+
/.gitattributes export-ignore

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.php_cs.cache
2+
/.php_cs
3+
/composer.phar
4+
/composer.lock
5+
/phpunit.xml
6+
/vendor/

.php_cs.dist

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
$header = <<<'HEADER'
4+
This file is part of the Mercure Component project.
5+
6+
(c) Kévin Dunglas <[email protected]>
7+
8+
For the full copyright and license information, please view the LICENSE
9+
file that was distributed with this source code.
10+
HEADER;
11+
12+
$finder = PhpCsFixer\Finder::create()->in(__DIR__);
13+
14+
return PhpCsFixer\Config::create()
15+
->setRiskyAllowed(true)
16+
->setRules([
17+
'@Symfony' => true,
18+
'@Symfony:risky' => true,
19+
'array_syntax' => [
20+
'syntax' => 'short',
21+
],
22+
'braces' => [
23+
'allow_single_line_closure' => true,
24+
],
25+
'declare_strict_types' => true,
26+
'header_comment' => [
27+
'header' => $header,
28+
'location' => 'after_open',
29+
],
30+
'modernize_types_casting' => true,
31+
'native_function_invocation' => true,
32+
'no_extra_consecutive_blank_lines' => [
33+
'break',
34+
'continue',
35+
'curly_brace_block',
36+
'extra',
37+
'parenthesis_brace_block',
38+
'return',
39+
'square_brace_block',
40+
'throw',
41+
'use',
42+
],
43+
'no_useless_else' => true,
44+
'no_useless_return' => true,
45+
'ordered_imports' => true,
46+
'phpdoc_add_missing_param_annotation' => [
47+
'only_untyped' => true,
48+
],
49+
'phpdoc_order' => true,
50+
'psr4' => true,
51+
'semicolon_after_instruction' => true,
52+
'strict_comparison' => true,
53+
'strict_param' => true,
54+
'ternary_to_null_coalescing' => true,
55+
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'namespaced'],
56+
])
57+
->setFinder($finder)
58+
;

.travis.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
language: php
2+
3+
jobs:
4+
include:
5+
- php: '7.1'
6+
- php: '7.2'
7+
env: lint=1
8+
- php: '7.2'
9+
env: deps=low
10+
11+
cache:
12+
directories:
13+
- $HOME/.composer/cache
14+
15+
before_install:
16+
- if [[ $lint = '1' ]]; then wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.13.1/php-cs-fixer.phar; fi
17+
- if [[ $lint = '1' ]]; then wget https://github.com/phpstan/phpstan/releases/download/0.10.5/phpstan.phar; fi
18+
19+
before_script:
20+
- phpenv config-rm xdebug.ini
21+
22+
install:
23+
- if [[ $deps = 'low' ]]; then
24+
composer update --prefer-dist --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi;
25+
else
26+
composer update --prefer-dist --no-progress --no-suggest --ansi;
27+
fi
28+
29+
script:
30+
- vendor/bin/simple-phpunit
31+
- if [[ $lint = '1' ]]; then php php-cs-fixer.phar fix --dry-run --diff --no-ansi; fi
32+
- if [[ $lint = '1' ]]; then php phpstan.phar analyse src tests --level=7; fi

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2018 Kévin Dunglas
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MercureBundle
2+
=============
3+
4+
Integrates [the Mercure Component](https://github.com/symfony/mercure) in the Symfony full-stack framework.

appveyor.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
build: false
2+
platform: x86
3+
clone_folder: c:\projects\symfony\panther
4+
5+
cache:
6+
- '%LOCALAPPDATA%\Composer\files'
7+
8+
install:
9+
- ps: Set-Service wuauserv -StartupType Manual
10+
- refreshenv
11+
- cd c:\tools\php72
12+
- copy php.ini-production php.ini /Y
13+
- echo date.timezone="UTC" >> php.ini
14+
- echo extension_dir=ext >> php.ini
15+
- echo extension=php_openssl.dll >> php.ini
16+
- echo extension=php_mbstring.dll >> php.ini
17+
- echo extension=php_curl.dll >> php.ini
18+
- echo memory_limit=3G >> php.ini
19+
- cd %APPVEYOR_BUILD_FOLDER%
20+
- composer install --no-interaction --no-progress
21+
22+
test_script:
23+
- cd %APPVEYOR_BUILD_FOLDER%
24+
- php vendor\bin\simple-phpunit

composer.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "symfony/mercure-bundle",
3+
"type": "symfony-bundle",
4+
"description": "Symfony MercureBundle",
5+
"keywords": ["mercure", "push", "sse", "updates"],
6+
"homepage": "https://symfony.com",
7+
"license": "MIT",
8+
"authors": [
9+
{
10+
"name": "Kévin Dunglas",
11+
"email": "[email protected]"
12+
},
13+
{
14+
"name": "Symfony Community",
15+
"homepage": "https://symfony.com/contributors"
16+
}
17+
],
18+
"require": {
19+
"php": "^7.1.3",
20+
"symfony/config": "^3.4|^4.0",
21+
"symfony/dependency-injection": "^3.4|^4.0",
22+
"symfony/http-kernel": "^3.4|^4.0",
23+
"symfony/mercure": "*"
24+
},
25+
"autoload": {
26+
"psr-4": { "Symfony\\Bundle\\MercureBundle\\": "src/" }
27+
},
28+
"autoload-dev": {
29+
"psr-4": { "Symfony\\Bundle\\MercureBundle\\Tests\\": "tests/" }
30+
},
31+
"extra": {
32+
"branch-alias": {
33+
"dev-master": "1.0.x-dev"
34+
}
35+
},
36+
"config": {
37+
"sort-packages": true
38+
},
39+
"require-dev": {
40+
"symfony/phpunit-bridge": "^4.1"
41+
},
42+
"suggest": {
43+
"symfony/messenger": "To use the Messenger integration"
44+
}
45+
}

phpstan.neon

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
autoload_files:
3+
- vendor/bin/.phpunit/phpunit-6.5/vendor/autoload.php
4+
ignoreErrors:
5+
# Intended
6+
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::.*\.#'
7+

phpunit.xml.dist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
5+
backupGlobals="false"
6+
colors="true"
7+
bootstrap="vendor/autoload.php"
8+
failOnRisky="true"
9+
failOnWarning="true"
10+
>
11+
<testsuites>
12+
<testsuite name="Project Test Suite">
13+
<directory>tests</directory>
14+
</testsuite>
15+
</testsuites>
16+
17+
<filter>
18+
<whitelist processUncoveredFilesFromWhitelist="true">
19+
<directory>.</directory>
20+
<exclude>
21+
<directory>tests</directory>
22+
<directory>vendor</directory>
23+
</exclude>
24+
</whitelist>
25+
</filter>
26+
</phpunit>

0 commit comments

Comments
 (0)