PHPackages                             newerton/api-correios - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. newerton/api-correios

ActiveLibrary[API Development](/categories/api)

newerton/api-correios
=====================

Biblioteca para PHP

2565PHP

Since Aug 3Pushed 11y ago1 watchersCompare

[ Source](https://github.com/newerton/api-correios)[ Packagist](https://packagist.org/packages/newerton/api-correios)[ RSS](/packages/newerton-api-correios/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Biblioteca do Correios
======================

[](#biblioteca-do-correios)

Está biblioteca está configurada para o funcionamento correto no Yii Framework.

Exemplo:

```
$correio = new Correios;

$address["cep_origem"] = $cep_origem;

if (Yii::app()->user->isGuest) {
	$address["cep_destino"] = $cep;
} else {
	$address["cep_destino"] = Yii::app()->user->cep;
}

try {
	$rows = $correio->getQuote($address);
	$this->renderPartial("index", array("rows" => $rows));
} catch (Exception $exc) {
	echo $exc->getTraceAsString();
}
```

O funcionamento de buscar os produtos do carrinho:

```
class Shop {

    public static function getCartContent() {
        if (is_string(Yii::app()->user->getState("carrinho")))
            return json_decode(Yii::app()->user->getState("carrinho"), true);
        else
            return Yii::app()->user->getState("carrinho");
    }

    public static function setCartContent($cart) {
        return Yii::app()->user->setState("carrinho", json_encode($cart));
    }
}
```

Controller que adiciona os produtos a sessão:

```
class CarrinhoController extends Controller {

    public function actionAdd($id) {

        $new = true;
        $cart = Shop::getCartContent();

        if (!is_null($cart)) {
            foreach ($cart as $key => $value) {
                if (($value["id"] == $id)) {
                    $new = false;
                    $cart[$key]["quant"] += 1;
                }
            }
        }

        if ($new)
            $cart[] = array("id" => $id, "quant" => 1);

        Shop::setCartcontent($cart);

        $this->redirect(Yii::app()->createAbsoluteUrl("cart"));
    }

}
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4175945?v=4)[Newerton](/maintainers/newerton)[@newerton](https://github.com/newerton)

---

Top Contributors

[![newerton](https://avatars.githubusercontent.com/u/4175945?v=4)](https://github.com/newerton "newerton (5 commits)")

### Embed Badge

![Health badge](/badges/newerton-api-correios/health.svg)

```
[![Health](https://phpackages.com/badges/newerton-api-correios/health.svg)](https://phpackages.com/packages/newerton-api-correios)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
