Skip to content

Commit

Permalink
Feature: upgrade to LTS symfony (#2)
Browse files Browse the repository at this point in the history
* update composer.json
* change autoloading from PSR-0 to PSR-4
* fix test suite
* refactor code for php74
* fix PHPStan issues
* apply coding standards
* update services.xml
* update travis-ci configuration
* remove php8 + symfony4.4 from travis matrix
* update README.md
  • Loading branch information
jkabat authored Apr 1, 2022
1 parent 1e7a4d6 commit b59389b
Show file tree
Hide file tree
Showing 29 changed files with 715 additions and 748 deletions.
22 changes: 22 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[*]
charset = utf-8
end_of_line = LF
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_style = space
indent_size = 4

[{*.json,*.yaml,*.yml}]
indent_style = space
indent_size = 4

[{*.less,*.sass,*.scss}]
indent_style = space
indent_size = 4

[*.md]
max_line_length = 120
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.idea/*
.phpunit
.phpunit.result.cache
composer.lock
phpunit.xml
var
vendor
6 changes: 6 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
tools:
external_code_coverage:
timeout: 600
Expand Down
21 changes: 9 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ language: php

matrix:
include:
- php: 5.4
env: SYMFONY_VERSION=2.1 deps=low
- php: 5.4
env: SYMFONY_VERSION=2.1
- php: 5.5
env: SYMFONY_VERSION=2.8
- php: 5.6
env: SYMFONY_VERSION=2.8
- php: 7.0
- php: 7.1
- php: 7.4
env: SYMFONY_VERSION=4.4 deps=low
- php: 7.4
env: SYMFONY_VERSION=5.4
- php: 8.0
env: SYMFONY_VERSION=5.4
- php: 8.0
env: SYMFONY_VERSION=6.0
allow_failures:
- php: nightly
- env: deps=dev
Expand All @@ -30,9 +28,8 @@ before_script:
- cp phpunit.xml.dist phpunit.xml

script:
- ./vendor/bin/simple-phpunit --coverage-text --coverage-clover=coverage.clover
- ./vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

60 changes: 0 additions & 60 deletions DependencyInjection/Configuration.php

This file was deleted.

36 changes: 0 additions & 36 deletions DependencyInjection/TzbSendyExtension.php

This file was deleted.

29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# TzbSendyBundle
# SendyBundle

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/df46d30d-af90-4e31-b5af-c7dc4f4bd139/mini.png)](https://insight.sensiolabs.com/projects/df46d30d-af90-4e31-b5af-c7dc4f4bd139)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jkabat/TzbSendyBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/jkabat/TzbSendyBundle/?branch=master)
[![Build Status](https://travis-ci.org/jkabat/TzbSendyBundle.svg?branch=master)](https://travis-ci.org/jkabat/TzbSendyBundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jkabat/sendy-bundle/badges/build.png?b=master)](https://scrutinizer-ci.com/g/jkabat/sendy-bundle/?branch=master)
[![Build Status](https://app.travis-ci.com/jkabat/sendy-bundle.svg?branch=master)](https://app.travis-ci.com/jkabat/sendy-bundle)

This bundle is used to integrate the [SendyPHP class from Jacob Bennett](https://github.com/JacobBennett/SendyPHP) into a symfony2 project.

Expand All @@ -14,7 +13,7 @@ Open a command console, enter your project directory and execute the
following command to download the latest stable version of this bundle:

```bash
$ composer require tzb/sendy-bundle "~1"
$ composer require jkabat/sendy-bundle
```

This command requires you to have Composer installed globally, as explained
Expand All @@ -35,11 +34,11 @@ class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
$bundles = [
// ...

new Tzb\SendyBundle\TzbSendyBundle(),
);
new Sendy\SendyBundle\SendyBundle(),
];

// ...
}
Expand All @@ -52,9 +51,9 @@ class AppKernel extends Kernel

```yaml
# app/config/config.yml
tzb_sendy:
sendy:
api_key: sendy_api_key
api_host: http://sendy.installation.url
api_host: https://sendy.installation.url
list_id: default_list_id
```
Expand All @@ -64,34 +63,34 @@ Get count of total active subscribers for default list:
```php
// get service
$sendy = $this->container->get('tzb_sendy.sendy_manager');
$sendy = $this->container->get('sendy.sendy_manager');
$count = $sendy->getSubscriberCount();
```

Get count of total active subscribers for other list:

```php
$sendy = $this->container->get('tzb_sendy.sendy_manager');
$sendy = $this->container->get('sendy.sendy_manager');
$count = $sendy->getSubscriberCount('other_list_id');
```

Get status of subscriber identified by e-mail:

```php
$sendy = $this->container->get('tzb_sendy.sendy_manager');
$sendy = $this->container->get('sendy.sendy_manager');
$status = $sendy->getSubscriberStatus('[email protected]');
```

Subscribe user to default list (other list id can be used as third parameter):

```php
$sendy = $this->container->get('tzb_sendy.sendy_manager');
$sendy = $this->container->get('sendy.sendy_manager');
$status = $sendy->subscribe('Name', '[email protected]');
```

Unsubscribe user from default list (other list id can be used as second parameter):

```php
$sendy = $this->container->get('tzb_sendy.sendy_manager');
$sendy = $this->container->get('sendy.sendy_manager');
$status = $sendy->unsubscribe('[email protected]');
```
28 changes: 0 additions & 28 deletions Resources/config/services.xml

This file was deleted.

14 changes: 0 additions & 14 deletions SendyException.php

This file was deleted.

Loading

0 comments on commit b59389b

Please sign in to comment.