Code Duplication    Length = 16-16 lines in 2 locations

src/BambooHr.php 2 locations

@@ 757-772 (lines=16) @@
754
     * @link http://www.bamboohr.com/api/documentation/employees.php#uploadEmployeeFile
755
     * @see listEmployeeFiles()
756
     */
757
    function uploadEmployeeFile($employeeId, $categoryId, $fileName, $contentType, $fileData, $shareWithEmployees = 'no') {
758
        $request=new BambooHttpRequest();
759
        $request->url=$this->baseUrl."/v1/employees/".intval($employeeId)."/files/";
760
        $request->method="POST";
761
762
        $params=array(
763
            "category"=>$categoryId,
764
            "fileName"=>$fileName,
765
            "share"=>$shareWithEmployees
766
        );
767
        $request->content=buildMultipart( BAMBOOHR_MULTIPART_BOUNDARY, $params, "file",$fileName,$contentType, $fileData);
768
        $request->headers[]="Content-Type: multipart/form-data; boundary=".BAMBOOHR_MULTIPART_BOUNDARY;
769
        $request->headers[]="Content-Length: ".strlen( $request->content );
770
771
        return $this->httpHandler->sendRequest( $request );
772
    }
773
774
    /**
775
     *
@@ 801-816 (lines=16) @@
798
     * @link http://www.bamboohr.com/api/documentation/employees.php#uploadCompanyFile
799
     * @see getCompanyFiles()
800
     */
801
    function uploadCompanyFile($categoryId, $fileName, $contentType, $fileData, $shareWithEmployees = 'no') {
802
        $request=new BambooHttpRequest();
803
        $request->url=$this->baseUrl."/v1/files/";
804
        $request->method="POST";
805
806
        $params=array(
807
            "category"=>$categoryId,
808
            "fileName"=>$fileName,
809
            "share"=>$shareWithEmployees
810
        );
811
        $request->content=buildMultipart( BAMBOOHR_MULTIPART_BOUNDARY, $params, "file",$fileName,$contentType, $fileData);
812
        $request->headers[]="Content-Type: multipart/form-data; boundary=".BAMBOOHR_MULTIPART_BOUNDARY;
813
        $request->headers[]="Content-Length: ".strlen( $request->content );
814
815
        return $this->httpHandler->sendRequest( $request );
816
    }
817
818
    /**
819
     *