Skip to content

Commit

Permalink
travis/CI
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Jul 13, 2019
1 parent ff96634 commit ee3b946
Show file tree
Hide file tree
Showing 65 changed files with 2,124 additions and 75 deletions.
61 changes: 61 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
sudo: true
language: php
addons:
mariadb: '10.2'
services:
- mysql
env:
global:
- PIMCORE_ENVIRONMENT=test
- DACHCOM_BUNDLE_TEST=1
- PIMCORE_TEST_URL=http://localhost
- PIMCORE_TEST_DB_DSN="mysql://root@localhost/dachcom_bundle_test"
- SYMFONY_DEPRECATIONS_HELPER=weak
- DACHCOM_TEST_SECTION=codeception
matrix:
include:
- name: "PHPStan Static Analysis (Pimcore 5.8.x, PHP 7.3)"
sudo: required
php: 7.3
env:
- PIMCORE_SKELETON_BRANCH="tags/v1.3.0"
- DACHCOM_TEST_SECTION=phpstan
- name: "PHP ECS (Pimcore 5.8.x, PHP 7.3)"
sudo: required
php: 7.3
env:
- PIMCORE_SKELETON_BRANCH="tags/v1.3.0"
- DACHCOM_TEST_SECTION=ecs
- name: "Codeception Tests ( Pimcore 5.8.x, PHP 7.2)"
sudo: required
php: 7.2
env:
- PIMCORE_SKELETON_BRANCH="tags/v1.3.0"
- name: "Codeception Tests ( Pimcore 5.8.x, PHP 7.3)"
sudo: required
php: 7.3
env:
- PIMCORE_SKELETON_BRANCH="tags/v1.3.0"
allow_failures:
- env:
- PIMCORE_SKELETON_BRANCH="tags/v1.3.0"
- DACHCOM_TEST_SECTION=ecs
fast_finish: true

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

install:
- tests/_etc/travis/install

after_failure:
- cd $TRAVIS_BUILD_DIR
- cat ./lib/DynamicSearchBundle/tests/_output/*

script:
- _etc/travis/script

notifications:
email:
- [email protected]
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
}
},
"require": {
"pimcore/pimcore": "^5.8.0",
"zf1/zend-search-lucene": "~1.12"
}
}
108 changes: 108 additions & 0 deletions easy-coding-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
imports:
- { resource: '%vendor_dir%/symplify/easy-coding-standard/config/psr2.yml' }

services:
PhpCsFixer\Fixer\Basic\BracesFixer:
allow_single_line_closure: true
PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer: ~
PhpCsFixer\Fixer\Operator\ConcatSpaceFixer:
spacing: one
PhpCsFixer\Fixer\Operator\NewWithBracesFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer:
tags:
- method
- param
- property
- return
- throws
- type
- var
PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer:
align_double_arrow: true
PhpCsFixer\Fixer\Operator\IncrementStyleFixer:
style: post
PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer: ~
PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer: ~
PhpCsFixer\Fixer\CastNotation\CastSpacesFixer: ~
PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer: ~
PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer: ~
PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer:
comment_types:
- hash
PhpCsFixer\Fixer\ControlStructure\IncludeFixer: ~
PhpCsFixer\Fixer\CastNotation\LowercaseCastFixer: ~
PhpCsFixer\Fixer\ClassNotation\ClassAttributesSeparationFixer:
elements:
- method
PhpCsFixer\Fixer\Casing\NativeFunctionCasingFixer: ~
PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer: ~
PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer: ~
PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer: ~
PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer: ~
PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer: ~
PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer: ~
PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer:
tokens:
- curly_brace_block
- extra
- parenthesis_brace_block
- square_brace_block
- throw
- use
PhpCsFixer\Fixer\NamespaceNotation\NoLeadingNamespaceWhitespaceFixer: ~
PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer: ~
PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer: ~
PhpCsFixer\Fixer\Semicolon\NoSinglelineWhitespaceBeforeSemicolonsFixer: ~
PhpCsFixer\Fixer\Whitespace\NoSpacesAroundOffsetFixer: ~
PhpCsFixer\Fixer\ControlStructure\NoTrailingCommaInListCallFixer: ~
PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer: ~
PhpCsFixer\Fixer\ArrayNotation\NoWhitespaceBeforeCommaInArrayFixer: ~
PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer: ~
PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer: ~
PhpCsFixer\Fixer\Operator\ObjectOperatorWithoutWhitespaceFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocAnnotationWithoutDotFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocInlineTagFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocNoAccessFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocNoPackageFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocScalarFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer: ~
PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer: ~
PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer: ~
PhpCsFixer\Fixer\CastNotation\ShortScalarCastFixer: ~
PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer: ~
PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer: ~
PhpCsFixer\Fixer\Operator\StandardizeNotEqualsFixer: ~
PhpCsFixer\Fixer\Operator\TernaryOperatorSpacesFixer: ~
PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer: ~
PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer: ~
PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer:
singleLine: true
PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer: ~
PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer: ~
PhpCsFixer\Fixer\Alias\NoMixedEchoPrintFixer:
use: echo
PhpCsFixer\Fixer\Import\NoLeadingImportSlashFixer: ~
PhpCsFixer\Fixer\Import\NoUnusedImportsFixer: ~
PhpCsFixer\Fixer\PhpUnit\PhpUnitFqcnAnnotationFixer: ~
PhpCsFixer\Fixer\Phpdoc\PhpdocNoAliasTagFixer: ~
PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer: ~
PhpCsFixer\Fixer\NamespaceNotation\SingleBlankLineBeforeNamespaceFixer: ~
PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer: ~

# new since PHP-CS-Fixer 2.6
PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer: ~
PhpCsFixer\Fixer\ClassNotation\NoUnneededFinalMethodFixer: ~
PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer: ~

# new since 2.11
PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer: ~
13 changes: 13 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
includes:
- ../../vendor/phpstan/phpstan-symfony/extension.neon
parameters:
reportUnmatchedIgnoredErrors: false
autoload_files:
- %currentWorkingDirectory%/vendor/pimcore/pimcore/stubs/compatibility-v4.php
symfony:
container_xml_path: var/cache/dev/appDevDebugProjectContainer.xml
ignoreErrors:
# There is no global constants definition file we could include, ignore it:
- '#Constant PIMCORE_[A-Z\\_]+ not found\.#'
# Symfony DI (remove this line with symfony 4.2):
- '#Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeDefinition::children\(\)\.#'
4 changes: 2 additions & 2 deletions src/DsLuceneBundle/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public function setConfig($config = [])
}

/**
* @param $slot
* @param string $slot
*
* @return mixed
*/
public function get($slot)
{
return $this->config[$slot];
}
}
}
3 changes: 1 addition & 2 deletions src/DsLuceneBundle/Configuration/ConfigurationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ interface ConfigurationInterface
const INDEX_BASE_GENESIS = self::INDEX_BASE . '/genesis';

const INDEX_BASE_STABLE = self::INDEX_BASE . '/stable';

}
}
2 changes: 1 addition & 1 deletion src/DsLuceneBundle/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ public function getConfigTreeBuilder()

return $treeBuilder;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public function load(array $configs, ContainerBuilder $container)
//$configManagerDefinition = $container->getDefinition(BundleConfiguration::class);
//$configManagerDefinition->addMethodCall('setConfig', [$config]);
}
}
}
1 change: 0 additions & 1 deletion src/DsLuceneBundle/DsLuceneBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ protected function getComposerPackageName(): string
return self::PACKAGE_NAME;
}
}

2 changes: 1 addition & 1 deletion src/DsLuceneBundle/Index/Field/AbstractType.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
abstract class AbstractType implements IndexFieldInterface
{
const UTF8 = 'UTF-8';
}
}
4 changes: 2 additions & 2 deletions src/DsLuceneBundle/Index/Field/BinaryField.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
final class BinaryField extends AbstractType
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function build(string $name, $data, array $configuration = [])
{
$field = \Zend_Search_Lucene_Field::binary($name, $data);
// $field->boost = $type->getBoost() > 1 ? $type->getBoost() : 1.0;
// $field->boost = $type->getBoost() > 1 ? $type->getBoost() : 1.0;

return $field;
}
Expand Down
4 changes: 2 additions & 2 deletions src/DsLuceneBundle/Index/Field/KeywordField.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
final class KeywordField extends AbstractType
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function build(string $name, $data, array $configuration = [])
{
$field = \Zend_Search_Lucene_Field::keyword($name, $data, self::UTF8);
// $field->boost = $type->getBoost() > 1 ? $type->getBoost() : 1.0;
// $field->boost = $type->getBoost() > 1 ? $type->getBoost() : 1.0;

return $field;
}
Expand Down
4 changes: 2 additions & 2 deletions src/DsLuceneBundle/Index/Field/TextField.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
final class TextField extends AbstractType
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function build(string $name, $data, array $configuration = [])
{
$field = \Zend_Search_Lucene_Field::text($name, $data, self::UTF8);
// $field->boost = $type->getBoost() > 1 ? $type->getBoost() : 1.0;
// $field->boost = $type->getBoost() > 1 ? $type->getBoost() : 1.0;

return $field;
}
Expand Down
2 changes: 1 addition & 1 deletion src/DsLuceneBundle/Index/Field/UnIndexedField.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
final class UnIndexedField extends AbstractType
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function build(string $name, $data, array $configuration = [])
{
Expand Down
4 changes: 1 addition & 3 deletions src/DsLuceneBundle/Index/Field/UnStoredField.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

namespace DsLuceneBundle\Index\Field;

use DynamicSearchBundle\Transformer\Container\FieldContainerInterface;

final class UnStoredField extends AbstractType
{
/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function build(string $name, $data, array $configuration = [])
{
Expand Down
8 changes: 4 additions & 4 deletions src/DsLuceneBundle/Normalizer/DocumentKeyValueNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DocumentKeyValueNormalizer implements DocumentNormalizerInterface
protected $options;

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
Expand All @@ -27,15 +27,15 @@ public function configureOptions(OptionsResolver $resolver)
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function setOptions(array $options)
{
$this->options = $options;
}

/**
* {@inheritDoc}
* {@inheritdoc}
*/
public function normalize(ContextDataInterface $contextData, string $outputChannelName, $data)
{
Expand All @@ -53,4 +53,4 @@ public function normalize(ContextDataInterface $contextData, string $outputChann

return $normalizedDocuments;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public function extract(\Zend_Search_Lucene_Search_QueryHit $hit)

$data = [];
foreach ($document->getFieldNames() as $fieldName) {

$field = null;
$fieldDefinition = null;

Expand All @@ -33,7 +32,5 @@ public function extract(\Zend_Search_Lucene_Search_QueryHit $hit)
}

return $data;

}

}
}
Loading

0 comments on commit ee3b946

Please sign in to comment.