Skip to content

Commit

Permalink
Merge pull request #121 from FriendsOfREDAXO/textile-via-composer
Browse files Browse the repository at this point in the history
Textile via composer
  • Loading branch information
alxndr-w authored Sep 22, 2022
2 parents aef3711 + 5410e2c commit cca0edc
Show file tree
Hide file tree
Showing 16 changed files with 502 additions and 426 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
*.iml
modules.xml
.idea/misc.xml
.idea/vcs.xml
.idea/encodings.xml
*.ipr
.DS_Store
vendor/composer/*
vendor/autoload.php
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"netcarver/textile": "^3.7.6"
}
}
78 changes: 78 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: markitup
version: '3.7.1'
version: '3.7.2-dev'
author: Friends Of REDAXO
supportpage: github.com/FriendsOfREDAXO/markitup

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ h1. Changelog

Here's a summary of changes in each release. The list doesn't include some small changes or updates to test cases.

h2. "Version 3.7.7 - 2022/05/01":https://github.com/textile/php-textile/releases/tag/v3.7.7

* Fix deprecation errors that appear on PHP >= 8.1 about preg_split limit argument's NULL value.

h2. "Version 3.7.6 - 2020/01/08":https://github.com/textile/php-textile/releases/tag/v3.7.6

* Support consecutive links without whitespace between using bracket syntax (closes "#202":https://github.com/textile/php-textile/issues/202, "#205":https://github.com/textile/php-textile/pull/205 and "#206":https://github.com/textile/php-textile/pull/206).
Expand Down
File renamed without changes.
82 changes: 82 additions & 0 deletions vendor/netcarver/textile/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
.PHONY: all clean help lint lint-fix test test-static test-unit bump bump-dev process-reports

IMAGE?=php_8_1
PHP = docker-compose run --rm $(IMAGE)

all: test

vendor:
$(PHP) composer install

clean:
$(PHP) rm -rf vendor composer.lock

lint: vendor
$(PHP) composer lint

lint-fix: vendor
$(PHP) composer lint-fix

test: vendor
$(PHP) composer test

test-static: vendor
$(PHP) composer test:static

test-unit: vendor
$(PHP) composer test:unit

bump: vendor
$(PHP) composer bump

bump-dev: vendor
$(PHP) composer bump-dev

process-reports:
$(PHP) bash -c "test -e build/logs/clover.xml && sed -i 's/\/app\///' build/logs/clover.xml"

help:
@echo "Manage project"
@echo ""
@echo "Usage:"
@echo " $$ make [command] ["
@echo " IMAGE=<image>"
@echo " ]"
@echo ""
@echo "Commands:"
@echo ""
@echo " $$ make lint"
@echo " Lint code style"
@echo ""
@echo " $$ make lint-fix"
@echo " Lint and fix code style"
@echo ""
@echo " $$ make test"
@echo " Run linter, static and unit tests"
@echo ""
@echo " $$ make test-unit"
@echo " Run unit tests"
@echo ""
@echo " $$ make test-static"
@echo " Run static tests"
@echo ""
@echo " $$ make bump"
@echo " Bump version"
@echo ""
@echo " $$ make bump-dev"
@echo " Bump development version"
@echo ""
@echo " $$ make clean"
@echo " Delete installed dependencies"
@echo ""
@echo " $$ make vendor"
@echo " Install dependencies"
@echo ""
@echo " $$ make process-reports"
@echo " Formats test reports to use relative local file paths"
@echo ""
@echo "Environment variables:"
@echo ""
@echo " IMAGE"
@echo " docker-compose service name that is used to run the command"
@echo ""
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
h1. PHP-Textile

"Downloads":https://github.com/textile/php-textile/releases | "Textile reference":https://textile-lang.com/ | "Live editor":https://textile-lang.com/doc
"Textile reference":https://textile-lang.com/ | "Live editor":https://textile-lang.com/doc

!https://img.shields.io/travis/textile/php-textile/master.svg!:https://travis-ci.org/textile/php-textile !https://img.shields.io/coveralls/github/textile/php-textile/master.svg!:https://coveralls.io/r/textile/php-textile?branch=master !https://img.shields.io/packagist/v/netcarver/textile.svg!:https://packagist.org/packages/netcarver/textile !https://img.shields.io/packagist/dt/netcarver/textile.svg!:https://packagist.org/packages/netcarver/textile
!https://sonarcloud.io/api/project_badges/measure?project=textile_php-textile&metric=coverage!:https://sonarcloud.io/summary/overall?id=textile_php-textile !https://img.shields.io/packagist/v/netcarver/textile.svg!:https://packagist.org/packages/netcarver/textile !https://img.shields.io/packagist/dt/netcarver/textile.svg!:https://packagist.org/packages/netcarver/textile

PHP-Textile is a modern Textile markup language parser for PHP. Textile is a humane web text generator that takes lightweight, readable, plaintext-like markup language and converts it into well formed HTML.

Expand Down Expand Up @@ -35,7 +35,7 @@ h3. Parsing single-line fields

If you are using PHP-Textile as a field-level formatter to parse just inline spans and glyphs, use the @setBlockTags@ method to disable block tags:

bc. $parser = new \Netcarving\Textile\Parser();
bc. $parser = new \Netcarver\Textile\Parser();
echo $parser
->setBlockTags(false)
->parse('Hello *strong* world!');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,27 @@
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": "5.7.*",
"symfony/yaml": "2.4.*",
"phpstan/phpstan": "1.6.3",
"phpunit/phpunit": "^9.5.20",
"squizlabs/php_codesniffer": "3.*",
"php-coveralls/php-coveralls": "2.1.*"
"symfony/yaml": "^4.4.3"
},
"extra": {
"branch-alias": {
"dev-master": "3.7-dev"
}
},
"scripts": {
"test": "./vendor/bin/phpunit",
"cs": "./vendor/bin/phpcs",
"test": [
"@composer lint",
"@composer test:static",
"@composer test:unit"
],
"bump": "@php ./scripts/release.php",
"bump-dev": "@php ./scripts/release.php --dev"
"bump-dev": "@php ./scripts/release.php --dev",
"lint": "phpcs",
"lint-fix": "phpcbf",
"test:static": "phpstan analyse --level 8 src",
"test:unit": "XDEBUG_MODE=coverage phpunit"
}
}
14 changes: 14 additions & 0 deletions vendor/netcarver/textile/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'

services:
php_8_1:
build: ./docker/image/php/8_1
volumes:
- .:/app
- ${COMPOSER_HOME:-$HOME/.composer}:/tmp
networks:
- app

networks:
app:
driver: bridge
16 changes: 16 additions & 0 deletions vendor/netcarver/textile/docker/image/php/8_1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM php:8.1-cli

RUN apt-get update && apt-get install -y \
bash \
git \
libz-dev \
zip \
wget

RUN pecl install xdebug

RUN docker-php-ext-enable xdebug

COPY --from=composer /usr/bin/composer /usr/bin/composer

WORKDIR /app
6 changes: 6 additions & 0 deletions vendor/netcarver/textile/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
ignoreErrors:
- '#Parameter \#2 \$callback of function preg_replace_callback#'
- "#Cannot access offset '[a-zA-Z0-9\\_]+' on non-empty-array#"
- '#Cannot access offset [0-9]+ on array#'
- "#Offset '[a-zA-Z0-9\\_]+' does not exist on array#"
8 changes: 8 additions & 0 deletions vendor/netcarver/textile/sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sonar.organization=textile
sonar.projectKey=textile_php-textile
sonar.projectName=PHP-Textile

sonar.sources=src
sonar.tests=test
sonar.sourceEncoding=UTF-8
sonar.php.coverage.reportPaths=build/logs/clover.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,20 @@
*
* @internal
*/

class DataBag
{
/**
* The data array stored in the bag.
*
* @var array
* @var array<string, int|string>
*/

protected $data;

/**
* Constructor.
*
* @param array|null $data The initial data array stored in the bag
* @param array<string, string|int>|null $data The initial data array stored in the bag
*/

public function __construct(array $data = null)
{
$this->data = (array) $data;
Expand All @@ -82,11 +79,10 @@ public function __construct(array $data = null)
* $plant = new DataBag(array('key' => 'value'));
* $plant->flower('rose')->color('red')->emptyValue(false, true);
*
* @param string $name The name
* @param array $params Arguments
* @return DataBag
* @param string $name The name
* @param array<int, int|string> $params Arguments
* @return DataBag
*/

public function __call($name, array $params)
{
if (!empty($params[1]) || !empty($params[0])) {
Expand Down
Loading

0 comments on commit cca0edc

Please sign in to comment.