Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirish committed May 1, 2018
0 parents commit b8149ee
Show file tree
Hide file tree
Showing 19 changed files with 616 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
@@ -0,0 +1,17 @@
# For more information about the properties used in this file,
# please see the EditorConfig documentation:
# http://editorconfig.org

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{*.yml,package.json}]
indent_size = 2

# The indent size used in the package.json file cannot be changed:
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
5 changes: 5 additions & 0 deletions .gitattributes
@@ -0,0 +1,5 @@
/tests export-ignore
/docs export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml export-ignore
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
npm-debug.log
node_modules/
37 changes: 37 additions & 0 deletions .scrutinizer.yml
@@ -0,0 +1,37 @@
inherit: true

#Copied from https://www.adayinthelifeof.nl/2013/11/20/external-code-coverage-with-travis-scrutinizer/
tools:
external_code_coverage:
timeout: 600
php_code_sniffer:
config:
standard: PSR2
php_cs_fixer:
extensions:
# Default:
- php
fixers: []
enabled: false
filter:
paths: [tests/*,src/*]
excluded_paths: []
coding_style:
php:
indentation:
general:
use_tabs: false

checks:
php:
code_rating: true
duplication: true

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

filter:
paths: [tests/*,src/*]
34 changes: 34 additions & 0 deletions .travis.yml
@@ -0,0 +1,34 @@
language: php

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

matrix:
include:
- php: 7.0
env: DB=MYSQL PHPUNIT_TEST=1 PHPCS_TEST=1
- php: 7.1
env: DB=MYSQL PHPUNIT_COVERAGE_TEST=1
- php: 5.6
env: DB=MYSQL 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
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,7 @@
# Changelog

All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.0]
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,3 @@
# Contributing

Contributions are welcome! Create an issue, explaining a bug or proposal. Submit pull requests if you feel brave.
12 changes: 12 additions & 0 deletions LICENSE.md
@@ -0,0 +1,12 @@
Copyright (c) 2018, Dynamic
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19 changes: 19 additions & 0 deletions README.md
@@ -0,0 +1,19 @@
# silverstripe-elemental-baseobject

a simple base dataobject to use with elements

## Requirements

- SilverStripe 3.2

## Installation

This is how you install silverstripe-elemental-baseobject.

## Example usage

You use silverstripe-elemental-baseobject like this.

## Documentation

See the [docs/en](docs/en/index.md) folder.
4 changes: 4 additions & 0 deletions _config.php
@@ -0,0 +1,4 @@
<?php

define('SILVERSTRIPE_ELEMENTAL-BASEOBJECT_PATH', __DIR__);
define('SILVERSTRIPE_ELEMENTAL-BASEOBJECT_DIR', basename(__DIR__));
3 changes: 3 additions & 0 deletions _config/config.yml
@@ -0,0 +1,3 @@
---
Name: silverstripeelemental-baseobjectconfig
---
40 changes: 40 additions & 0 deletions composer.json
@@ -0,0 +1,40 @@
{
"name": "dynamic/silverstripe-elemental-baseobject",
"description": "A simple base DataObject to use with Elemental Content Blocks",
"type": "silverstripe-vendormodule",
"authors": [
{
"name": "Dynamic",
"email": "dev@dynamicagency.com",
"homepage": "http://www.dynamicagency.com"
}
],
"keywords": [
"silverstripe", "elemental", "content", "blocks"
],
"type": "silverstripe-module",
"license": "BSD-3-Clause",
"require": {
"silverstripe/recipe-cms": "^1.0@dev",
"silverstripe/vendor-plugin": "^1.0@dev"
},
"require-dev": {
"phpunit/PHPUnit": "^5.7"
},
"config": {
"process-timeout": 600
},
"autoload": {
"psr-4": {
"Dynamic\\BaseObject\\": "src/",
"Dynamic\\BaseObject\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
}
}
5 changes: 5 additions & 0 deletions docs/en/index.md
@@ -0,0 +1,5 @@
# silverstripe-elemental-baseobject

a simple base dataobject to use with elements

## Getting started
3 changes: 3 additions & 0 deletions docs/en/userguide/index.md
@@ -0,0 +1,3 @@
# User Guide

This guide provides helpful tips for people using silverstripe-elemental-baseobject.
24 changes: 24 additions & 0 deletions phpcs.xml.dist
@@ -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
@@ -0,0 +1,14 @@
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
<testsuite name="silverstripe-elemental-baseobject">
<directory>tests</directory>
</testsuite>

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

0 comments on commit b8149ee

Please sign in to comment.