Skip to content

Commit

Permalink
Merge pull request #7 from mak001/SilverStripe-4
Browse files Browse the repository at this point in the history
SilverStripe 4
  • Loading branch information
micschk authored Jul 18, 2020
2 parents a36622f + 523eaa7 commit 97c34f3
Show file tree
Hide file tree
Showing 8 changed files with 307 additions and 115 deletions.
34 changes: 34 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
language: php

env:
global:
- COMPOSER_ROOT_VERSION=4.0.x-dev
- CODECOV_TOKEN=
- SCRUT_TOKEN=

matrix:
include:
- php: 7.1
env: DB=MYSQL PHPUNIT_TEST=1
- php: 7.2
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
- php: 7.3
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1

before_script:
# Init PHP
- phpenv rehash
- phpenv config-rm xdebug.ini
- echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini

# Install composer dependencies
- composer require --prefer-dist --no-update silverstripe-themes/simple:~3.2
- composer update --no-suggest --prefer-dist

script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml && wget https://scrutinizer-ci.com/ocular.phar; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/; fi

after_success:
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml -t $CODECOV_TOKEN && travis_retry php ocular.phar code-coverage:upload --format=php-clover --access-token=$SCRUT_TOKEN coverage.xml; fi
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SilverStripe GridField Groupable
[![Build Status](https://travis-ci.org/micschk/silverstripe-groupable-gridfield.svg?branch=master)](https://travis-ci.org/micschk/silverstripe-groupable-gridfield)
[![codecov.io](https://codecov.io/github/micschk/silverstripe-groupable-gridfield/coverage.svg?branch=master)](https://codecov.io/github/micschk/silverstripe-groupable-gridfield?branch=master)

This module allows drag & drop grouping of items in a GridField.
It bolts on top of- and depends on GridFieldOrderableRows for the drag & drop sorting functionality
Expand All @@ -17,7 +19,7 @@ Example application (Block Enhancements module): assign content blocks to block-

### Requirements (all pulled in by composer)

* SilverStripe CMS ~3.1
* SilverStripe Framework ~4.0
* SilverStripe GridFieldExtensions

## Usage:
Expand Down
4 changes: 0 additions & 4 deletions _config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
<?php

if (!defined('GROUPABLE_DIR')) {
define('GROUPABLE_DIR', rtrim(basename(dirname(__FILE__))));
}
25 changes: 22 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "micschk/silverstripe-groupable-gridfield",
"description": "This module allows drag & drop grouping of items in a GridField",
"type": "silverstripe-module",
"type": "silverstripe-vendormodule",
"keywords": [
"silverstripe",
"gridfield",
Expand All @@ -16,12 +16,31 @@
],
"license": "MIT",
"require": {
"symbiote/silverstripe-gridfieldextensions": "^2.1"
"silverstripe/vendor-plugin": "^1.0",
"symbiote/silverstripe-gridfieldextensions": "^3"
},
"require-dev": {
"phpunit/phpunit": "^5.7",
"squizlabs/php_codesniffer": "*"
},
"suggest": {
"micschk/silverstripe-block_enhancements": "Enhancements to the Silverstripe Blocks module"
},
"autoload": {
"psr-4": {
"micschk\\GroupableGridfield\\": "src/",
"micschk\\GroupableGridfield\\Test\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"installer-name": "gridfield_groupable"
"expose": [
"css",
"js"
],
"branch-alias": {
"dev-master": "2.0.x-dev"
}
}
}
24 changes: 24 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<ruleset name="SS4">
<description>Coding standard for SilverStripe 4.x</description>

<!-- Don't sniff third party libraries -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/thirdparty/*</exclude-pattern>

<!-- Show progress and output sniff names on violation, and add colours -->
<arg value="sp"/>
<arg name="colors"/>

<!-- Use PSR-2 as a base standard -->
<rule ref="PSR2">
<!-- Allow classes to not declare a namespace -->
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>

<!-- Allow underscores in class names -->
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>

<!-- Allow non camel cased method names -->
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
</rule>
</ruleset>
14 changes: 14 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
<testsuite name="groupalble-gridfield">
<directory>tests</directory>
</testsuite>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>
<exclude>
<directory suffix=".php">tests/</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
Loading

0 comments on commit 97c34f3

Please sign in to comment.