File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Emmetog \ProxyPool \Exception ;
4+
5+ /**
6+ * Thrown when a certain proxy is requested but it doesn't exist.
7+ */
8+ class ProxyNotFoundException extends \RuntimeException
9+ {
10+
11+ }
Original file line number Diff line number Diff line change 44
55use Emmetog \ProxyPool \Entity \Proxy ;
66use Emmetog \ProxyPool \Entity \ProxyUse ;
7+ use Emmetog \ProxyPool \Exception \ProxyNotFoundException ;
78
89interface ProxyRepositoryInterface
910{
11+ /**
12+ * Finds all alive proxies.
13+ *
14+ * @return Proxy[]
15+ */
1016 public function findAllAlive ();
1117
18+ /**
19+ * Finds a proxy by IP and port.
20+ *
21+ * Throws a ProxyNotFoundException if no proxy is found.
22+ *
23+ * @param string $ip
24+ * @param string $port
25+ * @return Proxy
26+ * @throws ProxyNotFoundException when the proxy doesn't exist
27+ */
28+ public function findByIpAndPort ($ ip , $ port );
29+
30+ /**
31+ * Inserts a new proxy.
32+ *
33+ * @param Proxy $proxy
34+ */
1235 public function insertProxy (Proxy $ proxy );
1336
37+ /**
38+ * Records a proxy as "used" along with the result.
39+ *
40+ * @param ProxyUse $proxyUse
41+ */
1442 public function insertUse (ProxyUse $ proxyUse );
1543
44+ /**
45+ * Gets the next id for a proxy.
46+ *
47+ * @return string
48+ */
1649 public function getNextIdProxy ();
1750
51+ /**
52+ * Gets the next id for a proxy use.
53+ *
54+ * @return string
55+ */
1856 public function getNextIdProxyUse ();
1957}
You can’t perform that action at this time.
0 commit comments