Skip to content

Commit 97c34f3

Browse files
authored
Merge pull request #7 from mak001/SilverStripe-4
SilverStripe 4
2 parents a36622f + 523eaa7 commit 97c34f3

File tree

8 files changed

+307
-115
lines changed

8 files changed

+307
-115
lines changed

.travis.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
language: php
2+
3+
env:
4+
global:
5+
- COMPOSER_ROOT_VERSION=4.0.x-dev
6+
- CODECOV_TOKEN=
7+
- SCRUT_TOKEN=
8+
9+
matrix:
10+
include:
11+
- php: 7.1
12+
env: DB=MYSQL PHPUNIT_TEST=1
13+
- php: 7.2
14+
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
15+
- php: 7.3
16+
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
17+
18+
before_script:
19+
# Init PHP
20+
- phpenv rehash
21+
- phpenv config-rm xdebug.ini
22+
- echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
23+
24+
# Install composer dependencies
25+
- composer require --prefer-dist --no-update silverstripe-themes/simple:~3.2
26+
- composer update --no-suggest --prefer-dist
27+
28+
script:
29+
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
30+
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml && wget https://scrutinizer-ci.com/ocular.phar; fi
31+
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/; fi
32+
33+
after_success:
34+
- 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

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# SilverStripe GridField Groupable
2+
[![Build Status](https://travis-ci.org/micschk/silverstripe-groupable-gridfield.svg?branch=master)](https://travis-ci.org/micschk/silverstripe-groupable-gridfield)
3+
[![codecov.io](https://codecov.io/github/micschk/silverstripe-groupable-gridfield/coverage.svg?branch=master)](https://codecov.io/github/micschk/silverstripe-groupable-gridfield?branch=master)
24

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

1820
### Requirements (all pulled in by composer)
1921

20-
* SilverStripe CMS ~3.1
22+
* SilverStripe Framework ~4.0
2123
* SilverStripe GridFieldExtensions
2224

2325
## Usage:

_config.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
<?php
2-
3-
if (!defined('GROUPABLE_DIR')) {
4-
define('GROUPABLE_DIR', rtrim(basename(dirname(__FILE__))));
5-
}

composer.json

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "micschk/silverstripe-groupable-gridfield",
33
"description": "This module allows drag & drop grouping of items in a GridField",
4-
"type": "silverstripe-module",
4+
"type": "silverstripe-vendormodule",
55
"keywords": [
66
"silverstripe",
77
"gridfield",
@@ -16,12 +16,31 @@
1616
],
1717
"license": "MIT",
1818
"require": {
19-
"symbiote/silverstripe-gridfieldextensions": "^2.1"
19+
"silverstripe/vendor-plugin": "^1.0",
20+
"symbiote/silverstripe-gridfieldextensions": "^3"
21+
},
22+
"require-dev": {
23+
"phpunit/phpunit": "^5.7",
24+
"squizlabs/php_codesniffer": "*"
2025
},
2126
"suggest": {
2227
"micschk/silverstripe-block_enhancements": "Enhancements to the Silverstripe Blocks module"
2328
},
29+
"autoload": {
30+
"psr-4": {
31+
"micschk\\GroupableGridfield\\": "src/",
32+
"micschk\\GroupableGridfield\\Test\\": "tests/"
33+
}
34+
},
35+
"minimum-stability": "dev",
36+
"prefer-stable": true,
2437
"extra": {
25-
"installer-name": "gridfield_groupable"
38+
"expose": [
39+
"css",
40+
"js"
41+
],
42+
"branch-alias": {
43+
"dev-master": "2.0.x-dev"
44+
}
2645
}
2746
}

phpcs.xml.dist

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="SS4">
3+
<description>Coding standard for SilverStripe 4.x</description>
4+
5+
<!-- Don't sniff third party libraries -->
6+
<exclude-pattern>*/vendor/*</exclude-pattern>
7+
<exclude-pattern>*/thirdparty/*</exclude-pattern>
8+
9+
<!-- Show progress and output sniff names on violation, and add colours -->
10+
<arg value="sp"/>
11+
<arg name="colors"/>
12+
13+
<!-- Use PSR-2 as a base standard -->
14+
<rule ref="PSR2">
15+
<!-- Allow classes to not declare a namespace -->
16+
<exclude name="PSR1.Classes.ClassDeclaration.MissingNamespace"/>
17+
18+
<!-- Allow underscores in class names -->
19+
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps"/>
20+
21+
<!-- Allow non camel cased method names -->
22+
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
23+
</rule>
24+
</ruleset>

phpunit.xml.dist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
2+
<testsuite name="groupalble-gridfield">
3+
<directory>tests</directory>
4+
</testsuite>
5+
6+
<filter>
7+
<whitelist addUncoveredFilesFromWhitelist="true">
8+
<directory suffix=".php">src/</directory>
9+
<exclude>
10+
<directory suffix=".php">tests/</directory>
11+
</exclude>
12+
</whitelist>
13+
</filter>
14+
</phpunit>

0 commit comments

Comments
 (0)