Skip to content

Commit

Permalink
Merge pull request #73 from creative-commoners/pulls/2.0/upgrade-module
Browse files Browse the repository at this point in the history
API Check module for SS4 compatibility
  • Loading branch information
robbieaverill authored Dec 14, 2017
2 parents 5e50e42 + f43c502 commit 2fcfce8
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 136 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
/.gitignore export-ignore
/.travis.yml export-ignore
/.scrutinizer.yml export-ignore
/phpunit.xml export-ignore
/phpunit.xml.dist export-ignore
/phpcs.xml.dist export-ignore
/codecov.yml export-ignore
74 changes: 10 additions & 64 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,15 @@
inherit: true

build:
nodes:
analysis:
tests:
override: [php-scrutinizer-run]

checks:
php:
verify_property_names: true
verify_argument_usable_as_reference: true
verify_access_scope_valid: true
useless_calls: true
use_statement_alias_conflict: true
variable_existence: true
unused_variables: true
unused_properties: true
unused_parameters: true
unused_methods: true
unreachable_code: true
too_many_arguments: true
sql_injection_vulnerabilities: true
simplify_boolean_return: true
side_effects_or_types: true
security_vulnerabilities: true
return_doc_comments: true
return_doc_comment_if_not_inferrable: true
require_scope_for_properties: true
require_scope_for_methods: true
require_php_tag_first: true
psr2_switch_declaration: true
psr2_class_declaration: true
property_assignments: true
prefer_while_loop_over_for_loop: true
precedence_mistakes: true
precedence_in_conditions: true
phpunit_assertions: true
php5_style_constructor: true
parse_doc_comments: true
parameter_non_unique: true
parameter_doc_comments: true
param_doc_comment_if_not_inferrable: true
optional_parameters_at_the_end: true
one_class_per_file: true
no_unnecessary_if: true
no_trailing_whitespace: true
no_property_on_interface: true
no_non_implemented_abstract_methods: true
no_error_suppression: true
no_duplicate_arguments: true
no_commented_out_code: true
newline_at_end_of_file: true
missing_arguments: true
method_calls_on_non_object: true
instanceof_class_exists: true
foreach_traversable: true
fix_line_ending: true
fix_doc_comments: true
duplication: true
deprecated_code_usage: true
deadlock_detection_in_loops: true
code_rating: true
closure_use_not_conflicting: true
catch_class_exists: true
blank_line_after_namespace_declaration: false
avoid_multiple_statements_on_same_line: true
avoid_duplicate_types: true
avoid_conflicting_incrementers: true
avoid_closing_tag: true
assignment_of_null_return: true
argument_type_checks: true
php:
code_rating: true
duplication: true

filter:
paths: [src/*, tests/*]
paths: [src/*, tests/*]
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ matrix:
env: DB=MYSQL PHPCS_TEST=1 PHPUNIT_TEST=1
- php: 7.0
env: DB=PGSQL PHPUNIT_TEST=1
- php: 7.0
env: DB=MYSQL PHPUNIT_TEST=1
- php: 7.1
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
- php: 7.2
env: DB=MYSQL PHPUNIT_TEST=1

before_script:
# Init PHP
Expand All @@ -31,7 +31,7 @@ before_script:
script:
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs --standard=vendor/silverstripe/framework/phpcs.xml.dist src/ tests/ ; fi
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/ *.php; fi

after_success:
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
18 changes: 0 additions & 18 deletions changelog.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/developer-tools.md

This file was deleted.

9 changes: 0 additions & 9 deletions docs/getting-started.md

This file was deleted.

23 changes: 0 additions & 23 deletions docs/introduction.md

This file was deleted.

9 changes: 9 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="SilverStripe">
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>

<rule ref="PSR2" >
<!-- Current exclusions -->
<exclude name="PSR1.Methods.CamelCapsMethodName" />
</rule>
</ruleset>
29 changes: 19 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Share Draft Content

[![Build Status](http://img.shields.io/travis/silverstripe/silverstripe-sharedraftcontent.svg?style=flat-square)](https://travis-ci.org/silverstripe/silverstripe-sharedraftcontent)
[![Code Quality](http://img.shields.io/scrutinizer/g/silverstripe/silverstripe-sharedraftcontent.svg?style=flat-square)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-sharedraftcontent)
[![Code Coverage](http://img.shields.io/scrutinizer/coverage/g/silverstripe/silverstripe-sharedraftcontent.svg?style=flat-square)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-sharedraftcontent)
[![Version](http://img.shields.io/packagist/v/silverstripe/sharedraftcontent.svg?style=flat-square)](https://packagist.org/packages/silverstripe/silverstripe-sharedraftcontent)
[![License](http://img.shields.io/packagist/l/silverstripe/sharedraftcontent.svg?style=flat-square)](LICENSE.md)
![helpfulrobot](https://helpfulrobot.io/silverstripe/sharedraftcontent/badge)
[![Build Status](https://travis-ci.org/silverstripe/silverstripe-sharedraftcontent.svg?branch=master)](https://travis-ci.org/silverstripe/silverstripe-sharedraftcontent)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/silverstripe/silverstripe-sharedraftcontent/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/silverstripe/silverstripe-sharedraftcontent/?branch=master)
[![codecov](https://codecov.io/gh/silverstripe/silverstripe-sharedraftcontent/branch/master/graph/badge.svg)](https://codecov.io/gh/silverstripe/silverstripe-sharedraftcontent)
[![Version](http://img.shields.io/packagist/v/silverstripe/sharedraftcontent.svg?style=flat)](https://packagist.org/packages/silverstripe/silverstripe-sharedraftcontent)
[![License](http://img.shields.io/packagist/l/silverstripe/sharedraftcontent.svg?style=flat)](LICENSE.md)

Share draft page content with non-CMS users.

Expand All @@ -17,17 +16,27 @@ This module adds a 'Share draft' action menu to the CMS. This enables Content Au

- SilverStripe ^4.0

Note: this version is compatible with SilverStripe 4. For SilverStripe 3, please see the 1.x release line.

## Installation

```
The easiest way to install is by using [Composer](https://getcomposer.org):

```sh
$ composer require silverstripe/sharedraftcontent
```

You'll also need to run `dev/build`.
You'll also need to run `dev/build`. You should now see a link/button on the bottom-right of edit pages. Clicking the link will generate a new share link.

# Developer Tools

Get the dependencies by running `npm install`.

After making changes to SCSS files, run the build script `npm run build`. This will compile everything for you and output minified CSS files to the `css` directory.

## Documentation
## Share Links

See the [docs/en](docs/en/introduction.md) folder.
The generated share links have a public key and hash. There can be any number of share links per-page, but all share links are unique, and cannot be used to gain access to pages other than the one each link was created for.

## Versioning

Expand Down
2 changes: 0 additions & 2 deletions src/Tasks/RemoveExpiredShareTokensTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
namespace SilverStripe\ShareDraftContent\Tasks;

use SilverStripe\Dev\BuildTask;
use SilverStripe\Security\Permission;
use SilverStripe\Security\Security;
use SilverStripe\ShareDraftContent\Models\ShareToken;

/**
Expand Down
1 change: 0 additions & 1 deletion tests/ShareDraftContentSiteTreeExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace SilverStripe\ShareDraftContent\Tests;

use Page;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Dev\FunctionalTest;
use SilverStripe\ShareDraftContent\Controllers\ShareDraftController;
Expand Down

0 comments on commit 2fcfce8

Please sign in to comment.